Journeyman
Journeyman

Reputation: 10271

Detect active javascript event handlers

How can I detect which javascript event handlers are currently active for the document? Or a particular element?

Upvotes: 1

Views: 2058

Answers (1)

Robert
Robert

Reputation: 8767

Using jQuery:

var ele = $("#web"); // Replace with specified element

ele.click(function(){});
ele.mouseover(function(){});

$.each(ele.data("events"), function(i, e) {     
    alert(i); 
});

Working example: http://jsfiddle.net/7HEuW/

Upvotes: 1

Related Questions