Created
October 5, 2014 16:58
-
-
Save joshblack/d3f2b1e86569c38fbb34 to your computer and use it in GitHub Desktop.
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
<div class="foo"></div> | |
<script> | |
document.querySelectorAll('.foo').addEventListener('click', function() { | |
console.log('You clicked me!'); | |
}); | |
// Or in jQuery | |
$('.foo').on('click', function() { | |
console.log('You clicked me!'); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment