摘要: 使用Date()获取日期 getMonth()+1得到当前月份 var ndate = new Date(); var nmonth = ndate.getMonth()+1; 弹窗显示 alert("当前月份:"+nmonth+"月"); 控制台输出 console.log("当前月份:"+nmo 阅读全文
posted @ 2022-01-03 10:40 富瑞阿得 阅读(1508) 评论(0) 推荐(0) 编辑
摘要: 两种方法在body元素中插入一个按钮 <input id='btn' type='button' value='按钮' /> 使用appendChild()方法插入 var inputbtn = document.createElement('input'); inputbtn.id="btn"; 阅读全文
posted @ 2022-01-03 10:20 富瑞阿得 阅读(2163) 评论(0) 推荐(0) 编辑
摘要: 非火狐(Firefox)浏览器 document.onmousewheel = function(e) { var e = e || window.event; if (e.wheelDelta < 0) { //鼠标下滑事件 } if (e.wheelDelta > 0) { //鼠标上滑事件 } 阅读全文
posted @ 2022-01-02 16:09 富瑞阿得 阅读(397) 评论(0) 推荐(0) 编辑