首先贴代码
<html>
<head>
<script src="../datetimepicker-master/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="../datetimepicker-master/jquery.datetimepicker.css"></link>
<script src="../datetimepicker-master/build/jquery.datetimepicker.full.min.js"></script>
<script type="text/javascript">
jQuery('#date1').datetimepicker();
</script>
</head>
<body>
<div>
<input type="text" id = "date1"/>
</div>
</body>
</html>
页面启动后F12未看到任何异常,不过点击输入框没有任何提示:
后来发现是因为把 jQuery('#date1').datetimepicker();这段代码放在上面==
将那个<script>移到<body>后面,插件正常使用
...
</body>
<script type="text/javascript">
jQuery('#date1').datetimepicker();
</script>
...