Add document onclick event handler : onClick « Event onMethod « JavaScript DHTML






Add document onclick event handler

   

<html> 

<head> 
<title>W3C DOM Event Propagation</title> 
<script type="text/javascript"> 
function init() { 

    document.onclick = docEvent; 
} 

function docEvent(evt) { 
    alert("Document level ."); 
} 
</script> 
</head> 
<body onload="init()"> 
</body> 
</html> 

   
    
    
  








Related examples in the same category

1.'onClick' Example
2.Anchor onclick event
3.Put all your JavaScript statement in onclick clause
4.Running a Script from User Action