what dom events will fire

179 views
Skip to first unread message

Eddified

unread,
Oct 31, 2008, 5:06:03 PM10/31/08
to Firebug
I am trying to figure out how to see what events are attached to a
given DOM element. For example, if I use javascript to add a listener
to the 'click' event of a DIV element like this:
myDiv.addEventListener('click', function(){alert('test');}, false);
and I inspect the DIV in the DOM tab, I can't see any 'click' event,
or 'onclick'. I don't understand how to see what fires when the
element is clicked.

I'm using firebug version 1.2.1

John J Barton

unread,
Oct 31, 2008, 6:32:56 PM10/31/08
to Firebug
If you click on the element and look in the Scripts tab locations do
you see an event script?

Eddified

unread,
Oct 31, 2008, 6:43:30 PM10/31/08
to Firebug
No. I dont see the event script. Instead, I see the HTML markup of the
page.

Eddified

unread,
Oct 31, 2008, 6:55:06 PM10/31/08
to Firebug
And yes, I also see the ability to have firebug show me event scripts.
But the point is I want firebug to show exactly which user code is
attached to which events given a DOM node. I can manually search
through all of the js code to find the line that caused the event to
be attached, but that doesn't really offer the functionality I'm
looking for.

John J Barton

unread,
Nov 1, 2008, 1:08:14 PM11/1/08
to Firebug
Sorry I was not clear. As far as I know there isn't a way to look at
the events. But it should be possible, is needed function, etc. So how
to make progress? I would start by looking into the browser generated
event scripts, simply because I know they exist.

jjb

Eddified

unread,
Nov 1, 2008, 11:11:59 PM11/1/08
to Firebug
"browser generated" event scripts? I'm not sure what you are talking
about. Perhaps I misunderstood what you were saying in your first
reply. Please elaborate. Thanks.

-Eddie

splintor

unread,
Nov 2, 2008, 1:11:43 AM11/2/08
to Firebug
Reply all
Reply to author
Forward
0 new messages