Created
July 30, 2010 17:36
-
-
Save nborwankar/500959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just got # 2 so far | |
// can do number 3 by removing first two handlers but apparently thats not what you want | |
<div id="the_div"> | |
<ul id="the_list"> | |
<li id="the_item">Click me!</li> | |
</ul> | |
</div> | |
<p id="log"></p> | |
<script type="text/javascript" charset="utf-8"> | |
function log(string){ | |
document.getElementById('log').innerHTML += (string + '<br/>'); | |
} | |
document.getElementById('the_div').addEventListener( | |
'click', function(){ log('the_div!') }, false); | |
document.getElementById('the_list').addEventListener( | |
'click', function(){ log('the_list!')}, false); | |
document.getElementById('the_item').addEventListener( | |
'click', function(){ log('the_item!') }, false); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment