Using Event Bubbling with the onClick Event
<HTML> <HEAD> <TITLE>Using Event Bubbling</TITLE> <SCRIPT><!-- function buttonClickHandler() { alert("The onClick event was handled by buttonClickHandler()") } function formClickHandler() { alert("The onClick event was handled by formClickHandler()") } function documentClickHandler() { alert("The onClick event was handled by documentClickHandler()") } //--></SCRIPT> </HEAD> <BODY ONCLICK="documentClickHandler()"> <H1>Using Event Bubbling</H1> <FORM ONCLICK="formClickHandler()"> <INPUT TYPE="BUTTON" ONCLICK="buttonClickHandler()" VALUE="Click here!"> </FORM> </BODY> </HTML>