Created
April 19, 2017 21:16
-
-
Save whitehat101/ab2386d5bb33be4bfa8946371290dc3f to your computer and use it in GitHub Desktop.
jQuery-ish multiple-event addEventListener in CoffeeScript
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
addEventListeners = (elem, events, callback) -> | |
events.split(' ').forEach (event) -> | |
elem.addEventListener event, callback, false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment