我正在尝试使用HTML
在DatePicker()
页面中显示日历。我已经包含了相应的UI js文件,但它仍然没有在UI中显示日历。
请帮助。我无法弄清楚我到底犯了什么错误。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Project Information</title>
<script src="../jquery-1.11.0.js"></script>
<script src="../jquery-ui.js"></script>
<script src="../jquery-ui.min.js"></script>
<script src="../jquery.ui.datepicker.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
$(document).ready(function(){
$("#datePicker").datepicker();
});
</script>
</head>
<body>
<form action="/projects/1" method="post">
<fieldset id="project_information">
<legend>Project Infomation</legend>
<ol>
<li><label for="priority">Project Name</label> <input
type="text" id="projectName" autofocus="autofocus"></li>
<li><label for="priority">Priority</label> <input type="range"
min="0" max="10" name="priority" value="0" id="priority"></li>
<li><label for="start_date">Start date</label> <input
type="text" name="start_date" id="start_date"
placeholder="YYYY-DD-MM" id="datePicker">
</li>
<li><input type="button" id="submit" value="clickMe"></li>
</ol>
</fieldset>
</form>
</body>
</html>
答案 0 :(得分:1)
你有2个ID删除1它将起作用
<input type="text" name="start_date" placeholder="YYYY-DD-MM" id="datePicker"/>
删除id="start_date".