Display events of DOM elements and their handlers

Possible duplicate:
Inspect attached event handlers for any DOM element

Is there a tool like a browser extension, a jQuery script console, a bookmarklet, or a Firebug plugin that displays all the events that can be triggered by a specific DOM element and include any event handlers that are currently listening to these events?

+3
source share
2 answers

You are looking for:

Firequery

http://firequery.binaryage.com/

To do this yourself, you can always access the structure events datawith jQuery object.

Example:

$(document.body).bind('click', function(){
   alert('I am an event handler!');
});

$.each($(document.body).data('events'), function(i,v){
  console.log(i);
  $.each(v, function(i2,v2){
    console.log(' > ', v2.handler.toString());
  });
});

FireBug/Webkit . .toString() v2 .

Anurag, , jQuery. addEventhandler() / addHandler inline-.

inline-, on-xxx. DOM level3 hasEventListenerNS, , - .

+3

Chrome , DOM, , , .

+1

Source: https://habr.com/ru/post/1758676/


All Articles