如何找出HTML元素附加的事件?

时间:2022-02-25 16:06:08

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.

我想更多地了解jQuery,我发现我想要做的一件事就是能够找出哪些事件附加到元素上。有没有办法在IE或Firebug中使用调试器,我可以找到它。我不是说通过查看源代码。我想做的是以与使用firebug检查CSS属性相同的方式查看事件。

3 个解决方案

#1


6  

Try FireQuery for FireFox

试试FireFox的FireQuery

http://firequery.binaryage.com/

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

当您检查FireBug中的元素时,它会显示附加到元素的所有事件。

#2


3  

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

只需执行jQuery('#elem_id')。data('events');在firebug控制台中,它将列出绑定到元素的所有事件。

#3


0  

You can see it with Opera Dragonfly too, just inspect the element and go to properties tab on the inspect sidebar:

您也可以使用Opera Dragonfly查看它,只需检查元素并转到检查侧栏上的属性选项卡:

如何找出HTML元素附加的事件?

#1


6  

Try FireQuery for FireFox

试试FireFox的FireQuery

http://firequery.binaryage.com/

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

当您检查FireBug中的元素时,它会显示附加到元素的所有事件。

#2


3  

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

只需执行jQuery('#elem_id')。data('events');在firebug控制台中,它将列出绑定到元素的所有事件。

#3


0  

You can see it with Opera Dragonfly too, just inspect the element and go to properties tab on the inspect sidebar:

您也可以使用Opera Dragonfly查看它,只需检查元素并转到检查侧栏上的属性选项卡:

如何找出HTML元素附加的事件?