-
-
Save goodbedford/e9a7a6057e4a558e4a354b4710e8b2dc to your computer and use it in GitHub Desktop.
Event Listeners
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 btn = document.querySelector("#post-button"); | |
var btnJquery = $("#post-button"); | |
var target = document.querySelector("#target"); | |
// vanilla javascript | |
btn.addEventListener("click", function(event) { | |
console.log("you clicked the button"); | |
}); | |
// jquery | |
btnJquery.on("click", function(event) { | |
console.log("you clicked the jquery version"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment