Skip to content

Instantly share code, notes, and snippets.

@stepheneyer
Last active August 29, 2015 14:20
Show Gist options
  • Save stepheneyer/ddd8b808af4b95a571a7 to your computer and use it in GitHub Desktop.
Save stepheneyer/ddd8b808af4b95a571a7 to your computer and use it in GitHub Desktop.
addEventListener and querySelector
window.addEventListener("load", function (){
alert("Loaded!");
var clicker = document.querySelector("#clicker");
clicker.addEventListener("click", function (event) {
alert("Yes, the button was clicked!");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment