Created
December 14, 2018 01:44
-
-
Save oneEyedSunday/f5c36ac7807c88ace61e25298a4d1055 to your computer and use it in GitHub Desktop.
Fix for closed loops
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
function handler(index) { | |
alert(index) | |
} | |
function hookupevents() { | |
for (var i = 0; i < 3; i++) { | |
document.getElementById("button" + i).addEventListener("click", handler.bind(this,i)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment