摘要:html>
&html>
div{ width: 300px; height: 60px; border-bottom: 1px solid red; line-height: 60px; }
input{ border: none; width:120px; height:40px; background: #ffa200; color: #fff; text-align: center; line-height: 40px; font-size: 14px; margin-top: 30px;}
function btn(x){
var myDiv= document.getElementById("myDiv");
var myday=new Date();
var month = new Array(12);
month[0]="1";
month[1]="2";
month[2]="3";
month[3]="4";
month[4]="5";
month[5]="6";
month[6]="7";
month[7]="8";
month[8]="9";
month[9]="10";
month[10]="11";
month[11]="12";
myDiv.innerHTML = myday.getFullYear() + '年' + month[myday.getMonth()] + '月' + myday.getDate() + '日' + myday.getHours() + '时' + myday.getMinutes() + '分' + myday.getSeconds() + '秒' + '星期' + myday.getDay();
}
批改老师:天蓬老师批改时间:2019-04-13 09:11:06
老师总结:日期对象的作用非常大,试想一个,如果你的项目的日期错误, 那么基于它上面的很多应用都无从谈起...
获取,设置日期, 可以实现很多有意思的事情, 例如倒计时, 给用户提示, 提交表单, 抽奖等.....