摘要:
使用Date()获取日期 getMonth()+1得到当前月份 var ndate = new Date(); var nmonth = ndate.getMonth()+1; 弹窗显示 alert("当前月份:"+nmonth+"月"); 控制台输出 console.log("当前月份:"+nmo 阅读全文
摘要:
两种方法在body元素中插入一个按钮 <input id='btn' type='button' value='按钮' /> 使用appendChild()方法插入 var inputbtn = document.createElement('input'); inputbtn.id="btn"; 阅读全文