Last active
July 7, 2018 09:44
-
-
Save ArunHub/dfeccbdb1bd7bee834ce70abd19f3512 to your computer and use it in GitHub Desktop.
alert the buttons text //source https://jsbin.com/fawepetaha
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 buttons = document.getElementsByClassName('btn'); | |
function alertText(){ | |
alert(this.innerHTML); | |
} | |
for(var i=0; i<buttons.length;i++){ | |
buttons[i].addEventListener("click", alertText); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment