在jquery mobile中添加天数到当前日期

时间:2016-02-03 18:01:56

标签: javascript jquery jquery-mobile

我有以下html文件:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Datepicker - jQuery Mobile Demos</title>
    <link rel="stylesheet" href="../css/themes/default/jquery.mobile-1.4.5.min.css">
    <link rel="stylesheet" href="../_assets/css/jqm-demos.css">
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
    <link rel="stylesheet" href="http://cdn.rawgit.com/arschmitz/jquery-mobile-datepicker-wrapper/v0.1.1/jquery.mobile.datepicker.css">
    <script src="../js/jquery.js"></script>
    <script src="../_assets/js/index.js"></script>
    <script src="../js/jquery.mobile-1.4.5.min.js"></script>
    <script src="http://cdn.rawgit.com/jquery/jquery-ui/1.10.4/ui/jquery.ui.datepicker.js"></script>
    <script id="mobile-datepicker" src="http://cdn.rawgit.com/arschmitz/jquery-mobile-datepicker-wrapper/v0.1.1/jquery.mobile.datepicker.js"></script>

    <script>

    $("#resultDate").datepicker( "setDate" , "7/11/2011" );


    </script>

</head>
<body>
<div data-role="page" class="jqm-demos" data-quicklinks="false">

   <!-- /header -->

    <div role="main" class="ui-content jqm-content">

        <h2>Inline Datepicker</h2>

        <div data-demo-html="true">
            <input type="text" data-role="date" data-inline="true" disabled id="inputDate">
            <input type="number" value="40" id="days">
            <input type="text" data-role="date" data-inline="true" disabled id="resultDate" >
        </div>

    </div><!-- /content -->

</div><!-- /page -->

</body>
</html>

这是来自jquery mobile

的演示

我需要创建一个java脚本函数,它会在第一个文本字段中添加若干天,并在最后一个文本字段中显示结果。

如果它也会更新第二个选择器值,那将会很棒。

0 个答案:

没有答案