Add event handler listener to document : Event Handler « Event « JavaScript Tutorial






<html> 

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

    document.addEventListener("click", docEvent, true); 
} 

function docEvent(evt) { 
    alert("Document level."); 
} 

</script> 
</head> 
<body onload="init()"> 
</body> 
</html>








15.12.Event Handler
15.12.1.Add event handler listener to document
15.12.2.Preventing Bubble and Capture
15.12.3.Register mouse down event(IE)
15.12.4.Event Handlers and this
15.12.5.Event Bubbling (Firefox)
15.12.6.Capturing events
15.12.7.Add event listener to form
15.12.8.Add event listener to elements in a form
15.12.9.Bubble up events (Firefox)
15.12.10.Inline DOM Event Registration