DedeCMS自定义表单,显示默认时间

<input id=”time” name=”time” type=”text” class=”txts” value=”” style=”display:none”>

<script type=”text/javascript”>
window.onload = function(){
var nowDate = new Date();
var str = nowDate.getFullYear()+”-“+(nowDate.getMonth() + 1)+”-“+nowDate.getDate()+” “+nowDate.getHours()+”:”+nowDate.getMinutes()+”:”+nowDate.getSeconds();
document.getElementById(“time”).value=str;
}
</script>

发表评论

邮箱地址不会被公开。 必填项已用*标注