Created
February 22, 2015 16:09
-
-
Save jamc92/ca1fb6d83cd41edd9a05 to your computer and use it in GitHub Desktop.
JS - getInfoEvent
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> Evento de información </title> | |
<script> | |
function infoButton(buttonId, buttonName, buttonValue) { | |
var idButton = "ID del boton " + buttonId + " \n"; | |
var nameButton = "Button's name: " + buttonName + " \n"; | |
var valueButton = "Button's value: " + buttonValue + " \n"; | |
alert(idButton + nameButton + valueButton); | |
} | |
</script> | |
</head> | |
<body> | |
<input id="1" type="button" name="First Button" value="Left Button" onclick="infoButton(this.id, this.name, this.value);" /> | |
<input id="2" type="button" name="Second Button" value="Center Button" onclick="infoButton(this.id, this.name, this.value);" /> | |
<input id="3" type="button" name="Third Button" value="Right Button" onclick="infoButton(this.id, this.name, this.value);" /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment