Created
March 12, 2017 10:12
-
-
Save Dosant/086223ccf7249f4e73326ec94c6cce0b to your computer and use it in GitHub Desktop.
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
<form>FORM | |
<div>DIV | |
<p>P</p> | |
</div> | |
</form> |
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
function handleEvent(event) { | |
alert(event.currentTarget); | |
} | |
var form = document.querySelector('form'); | |
var div = document.querySelector('div'); | |
var p = document.querySelector('p'); | |
form.addEventListener('click', handleEvent); | |
div.addEventListener('click', handleEvent); | |
p.addEventListener('click', handleEvent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment