Skip to content

Instantly share code, notes, and snippets.

@arya
Created April 16, 2009 00:38
Show Gist options
  • Save arya/96124 to your computer and use it in GitHub Desktop.
Save arya/96124 to your computer and use it in GitHub Desktop.
<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