Created
January 22, 2018 15:44
-
-
Save JakeTheCorn/9b19cd0aae3ae131622313de08879b34 to your computer and use it in GitHub Desktop.
This file contains 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 el = document.getElementById('hplogo'); | |
var tearItDown = setClickListener(el, function() { | |
console.log('2222222'); | |
}); | |
tearItDown(); | |
function setClickListener(element, fn) { | |
element.addEventListener('click', fn); | |
return function tearDown() { | |
element.removeEventListener('click', fn) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment