直接上代码
<head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Datepicker - Default functionality</title><link href="~/Content/themes/base/jquery-ui.min.css" rel="stylesheet" /> <script src="~/Scripts/jquery-3.1.1.js"></script> /// 必须 <script src="~/Scripts/jquery-ui-1.12.1.min.js"></script> /// 必须 <script> $(function () { $("#datepicker").datepicker({ /// 选项都可以不要, dateFormat: "yy-mm-dd", /// 默认:mm/dd/yy , 设置格式:yy-mm-dd ,DD, d MM, yy showOn: "button", buttonImage: "../Images/calendar.gif", /// 设置图标 //changeMonth: true, /// 出现月 选项 changeYear: true /// 可选项 }); }); </script> </head> <div class="demo-section k-content" style="text-align: center;"> <h4>Pick a date</h4> <p>Date: <input type="text" id="datepicker" value="02/27/2017"></p> </div>
直接 这样:
<link href="~/Content/themes/base/jquery-ui.min.css" rel="stylesheet" /> <script src="~/Scripts/jquery-3.1.1.js"></script> /// 必须 <script src="~/Scripts/jquery-ui-1.12.1.min.js"></script>
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>
<p>Date: <input type="text" id="datepicker" value="02/27/2017"></p>
PS: http://jqueryui.com/datepicker/#default
时间: 2024-10-10 23:23:50