Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
Last active January 8, 2016 19:59
Show Gist options
  • Save aalvesjr/2c3002a8232145c8149a to your computer and use it in GitHub Desktop.
Save aalvesjr/2c3002a8232145c8149a to your computer and use it in GitHub Desktop.
jQuery multiple events to trigger the same function

You can use .on() to bind a function to multiple events:

$('#element').on('keyup keypress blur change', function(e) {
    // e.type is the type of event fired
});

font: stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment