Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out what events are attached to HTML elements?

I would like to understand more about jQuery and I'm finding one thing I would like to do is to be able to find out what events are attached to elements. Is there some way using the debugger in IE or Firebug that I can find this out. I don't mean by looking at the source code. What I would like to do is to see events in the same way as I can check out CSS properties with firebug.

like image 810
Samantha J T Star Avatar asked Jan 14 '12 17:01

Samantha J T Star


People also ask

How do you find the events of an element?

Right-click the element. In the context menu, Click 'Inspect Element' If there is an 'ev' icon next to the element (yellow box), click on 'ev' icon. Displays all events for that element and event handler.

How do I know which element was clicked in HTML?

The buttonPressed() callback function will have a returned event object which has all the data about the HTML element that is clicked on. To get the clicked element, use target property on the event object. Use the id property on the event. target object to get an ID of the clicked element.


2 Answers

Try FireQuery for FireFox

http://firequery.binaryage.com/

When you inspect the elements in FireBug, it shows you all of the events attached to the element.

like image 133
jcreamer898 Avatar answered Sep 21 '22 04:09

jcreamer898


simply execute jQuery('#elem_id').data('events'); in the firebug console, it will list all the events bound to the elements.

like image 26
dku.rajkumar Avatar answered Sep 22 '22 04:09

dku.rajkumar