1、(运行文件在我的资源中)
注意事项:
①、导包,
②、在 script 中绑定方法加载时间组件
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS-->
<link rel="stylesheet" type="text/css" href="./css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="./css/date/bootstrap-datetimepicker.css">
<title>index</title>
<script src="./js/bootstrap.js" type="text/javascript"></script>
<script src="./js/ajax-1-1.js" type="text/javascript"></script>
<script type="text/javascript" src="./js/date/bootstrap-datepicker.min.js"></script>
<!-- Javascripts-->
<script src="./js/jquery.min.js" type="text/javascript"></script>
<!--时间组件-->
<script src="./js/date/currency.min.js"></script>
<script src="./js/date/moment.min.js"></script>
<script src="./js/date/datepicker.all.js"></script>
<link rel="stylesheet" type="text/css" href="./css/date/datepicker.min.css">
<script src="./js/date/validate.js"></script>
</head>
<body onload="loadData()">
<div class="c-datepicker-date-editor c-datepicker-single-editor J-datepicker-day">
<i class="c-datepicker-range__icon kxiconfont icon-clock"></i>
<input type="text" id="birthday"
autocomplete="off" name="birthday"
placeholder="选择日期"
class=" c-datepicker-data-input form-control"
value="" autocomplete="off">
</div>
</body>
<script>
function loadData() {
//年月日单个
$('.J-datepicker-day').datePicker({
hasShortcut: false,
format: 'YYYY-MM-DD'
});
var birthday= $("#birthday").val()
console.log(birthday)
}
</script>
</html>