Created
April 20, 2012 16:29
-
-
Save winsonwq/2430135 to your computer and use it in GitHub Desktop.
bubble and capture
This file contains hidden or 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
var outer = document.getElementById('outer'); | |
var inner = document.getElementById('inner'); | |
outer.addEventListener('click', function(evt){ | |
console.log(evt.target); | |
alert(0); | |
}, false); | |
inner.addEventListener('click', function(evt){ | |
console.log(evt.currentTarget); | |
alert(1); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment