+ 1
How event works? Anybody plz explain for me..thnx
I don't have any idea about how event work in js
1 Answer
+ 2
event in javascript works as follows in the script whenever there's attachment of eventlistener it registers in the dom element as the target it is attached to. now whenever it gets notified that event in the client happened it triggers the set function if you are asking how to use
button.addEventListenr("click",clicked(event));
function clicked(event){
document.write(event.pageX+" "+event.pageY) ;
}