<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <script type="text/javascript" src="jquery-1.3.2.js"></script> <script type="text/javascript"> jQuery(function() { jQuery("#clickable").click(function() { alert("Clicked " + this.id); }); jQuery("#clickable2").click(function() { alert("Clicked " + this.id); }); }); </script> </head> <body> <img id="close" onclick="var e = document.getElementById('elementToHide');e.removeChild(e.firstChild)" alt="close"/> <div id="elementToHide">elementToHide</div> <div id="clickable">Click me</div> <div id="clickable2"> <a> <span id="clickable2child">Clickable child</span> </a> </div> </body> </html>