Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
<button onclick="alert('哈哈')">按钮1</button>
<button>按钮2</button>
<button>按钮3</button>
<button onclick="se(event)">按钮4</button>
const btn=document.querySelector("button:nth-of-type(2)");
btn.addEventListener("click",()=>console.log(1)); //测试按钮
let showtime=()=>console.log('事件');
btn.removeEventListener("click",btn);
const btn3=document.querySelector("button:nth-of-type(3)");
let j=0;
btn3.addEventListener("click",()=>{
console.log("加钱:"+j+"元");
j+=1;
});
setTimeout(()=>console.log(2),2000);//一次性定时器函数
setInterval(()=>console.log(2),2000);//间歇性定时器
function se(eve){
console.log(eve.type);
}