Skip to content

Instantly share code, notes, and snippets.

@carlosrojaso
Created May 15, 2014 11:00
Show Gist options
  • Save carlosrojaso/3cb47850f0e0d60e7536 to your computer and use it in GitHub Desktop.
Save carlosrojaso/3cb47850f0e0d60e7536 to your computer and use it in GitHub Desktop.
jQuery Event Basics
// Event setup using a convenience method
$( "p" ).click(function() {
console.log( "You clicked a paragraph!" );
});
// Equivalent event setup using the `.on()` method
$( "p" ).on( "click", function() {
console.log( "click" );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment