Skip to content

Instantly share code, notes, and snippets.

@jeremeamia
Created April 17, 2010 00:08
Show Gist options
  • Save jeremeamia/369111 to your computer and use it in GitHub Desktop.
Save jeremeamia/369111 to your computer and use it in GitHub Desktop.
Check event bindings
// Adds a hasEvent() function for jQuery objects.
// Example: var hasClickEvent = $('a.add').hasEvent('click');
(function($){
$.fn.hasEvent = function(eventType){
var events = this.data("events");
return (events && events[eventType]);
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment