输入框中的日历

时间:2015-01-19 12:38:21

标签: javascript jquery html5

我想在输入框中显示datepicker.4天此代码显示datepicker.Now我修改未知。我不知道我改变了什么。我附上了我的代码

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <link rel="stylesheet" type="text/css" href="http://www.jscodes.com/codes/calendar_javascript/demo/css/datePicker.css" />
    <script src="http://www.jscodes.com/codes/calendar_javascript/demo/js/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="http://www.jscodes.com/codes/calendar_javascript/demo/js/jquery.datePicker-min.js" type="text/javascript"></script>

    <title>Content Delv Logs</title>
     <script type="text/javascript">
        $(window).ready(function() {
            $('#date-pick').datePicker({clickInput: true});
        });
    </script>
</head>

<body>
        <input type="text" name="date" id="date-pick" value=""/>
</body>

2 个答案:

答案 0 :(得分:2)

在头标记中添加此链接。你缺少jQuery UI库:

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>

答案 1 :(得分:1)

&#13;
&#13;
  $(function() {
    $( "#datepicker" ).datepicker();
  });
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<p>Date: <input type="text" id="datepicker"></p>
&#13;
&#13;
&#13;

使用jquery UI,有很多功能和更多给予;;;

  

http://jqueryui.com/

     

http://jqueryui.com/datepicker/