标签:style color io ar for art sp cti 代码
添加如下代码,其中startTime为<input >中id值
<script>//得到当前日期
formatterDate = function(date) {
var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0"
+ (date.getMonth() + 1);
return date.getFullYear() + ‘-‘ + month + ‘-‘ + day;
};
window.onload = function () {
$(‘#startTime‘).datebox(‘setValue‘, formatterDate(new Date()));
}
</script>
jquery easyui datebox 时间控件默认显示当前日期的实现方法
标签:style color io ar for art sp cti 代码
原文地址:http://my.oschina.net/ajian2014/blog/315921