Inline Event :
>overrides existing event handler
//overrides if same event is called multiple times
btn2.onclick = () =>{
alert("2nd way")
}
Event listner :
>does not override existing event handler
//multiple event can be called
btn3.addEventListener('click' , ()=>{
alert("3rd way")
})
0 Comments