摘要: var divs = document.querySelectorAll('div'); divs[0].onclick = function() { alert(11); // 1. 传统方式删除事件 divs[0].onclick = null; } // 2. removeEventListe 阅读全文
posted @ 2022-05-24 18:36 hi123hi159 阅读(336) 评论(0) 推荐(0)
摘要: var btns = document.querySelectorAll('button'); // 1. 传统方式注册事件 btns[0].onclick = function() { alert('hi'); } btns[0].onclick = function() { alert('hao 阅读全文
posted @ 2022-05-24 15:12 hi123hi159 阅读(242) 评论(0) 推荐(0)