Created
May 13, 2014 06:40
-
-
Save felixzapata/a711b31278dfcb41a908 to your computer and use it in GitHub Desktop.
How to pass arguments to addEventListener listener function?
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 someInput = document.querySelector('input'); | |
someInput.addEventListener('click', myFunc, false); | |
someInput.myParam = 'This is my parameter'; | |
function myFunc(evt){ | |
window.alert( evt.target.myParam ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment