Created
April 16, 2009 00:38
-
-
Save arya/96124 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
<div id="body"> | |
<div id="link_test"> | |
<a href="#should_not_show_up" id="the_link">Click Me</a> | |
</div> | |
<script type="text/javascript"> | |
function TestCase() { | |
document.getElementById('link_test').addEventListener('click', function(){ | |
console.log('clicked from container'); | |
return false; | |
}); | |
document.getElementById('the_link').addEventListener('click', function(e) { | |
console.log("click from inside"); | |
e.stopPropagation(); | |
e.preventDefault(); | |
return false; | |
}); | |
} | |
TestCase(); | |
</script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment