<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"/> <title>IE Event Model</title> </Head> <Body> <inputtype= "button"value= "Event Object"/> <P>Event propagation Process:</P> <Script>window.onload=function(){ varbtn=document.getElementsByTagName ("input")[0]; varP=document.getElementsByTagName ("P")[0]; varI=1; Do{ if(Btn.addeventlistener) {Btn.addeventlistener ("Click",function() {p.innerhtml+="<br/> ("+I++ +") "+ This. NodeName; },false); } Else{btn.attachevent ("onclick",(function(BTN) {return function(){ //returns the closure function, which dynamically locks the current object of the response eventp.innerhtml+="<br/> ("+I++ +") "+Btn.nodename; }}) (BTN)); //call a function directly to pass the current binding element object internally} btn=Btn.parentnode; } while(BTN); } </Script> </Body></HTML>
IE Event Model
Event propagation Process:
IE event model, how to add events to IE and non ie browsers