JQuery datepicker不适用于上一版本

时间:2015-05-27 09:20:39

标签: jquery datepicker

我第一次尝试使用jquery,但我无法使用它。

我的代码如下:

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Display inline</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <script src="@Url.Content("~/Scripts/datepicker/jquery.ui.datepicker.js")" type="text/javascript"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
</head>
<body>

Date: <div id="datepicker"></div>


</body>
</html>

1 个答案:

答案 0 :(得分:1)

试试这个..

将div替换为日期:<input type="text" id="datepicker" />

<html lang="en">
    <head>
      <meta charset="utf-8">
      <title>jQuery UI Datepicker - Display inline</title>
      <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
      <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
      <script src="@Url.Content("~/Scripts/datepicker/jquery.ui.datepicker.js")" type="text/javascript"></script>
      <link rel="stylesheet" href="/resources/demos/style.css">
      <script>
      $(function() {
        $( "#datepicker" ).datepicker();
      });
      </script>
    </head>
    <body>

    Date: 
    <input type="text" id="datepicker" />

    </body>
    </html>