使用Chrome开发工具/ Firebug / IE开发人员工具栏查找元素的附加/绑定事件 [英] Find attached / bound events of an element using Chrome Development Tools / Firebug / IE Developer Toolbar

查看:176
本文介绍了使用Chrome开发工具/ Firebug / IE开发人员工具栏查找元素的附加/绑定事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在检查页面的DOM时,我想快速了解元素的附加事件

When inspecting a page's DOM, I would like to know the attached event(s) of an element quickly

例如,如果按钮具有此HTML DOM

For example, if a button has this HTML DOM

<button id="button1">Click Me</button>

在某处(不在我事先知道的地方)它附有一个事件,例如

And somewhere (not in a place that I know in advance) it has an event attached, e.g.

$("#button1").click(function(){...});

我知道它可以以编程方式完成(我可以使用jQuery查找绑定在元素上的事件吗?

I know it can be done programatically ( Can I find events bound on an element with jQuery? )

但有没有办法只使用Chrome / Firefox / IE的开发者工具之一来查看事件列表?

but is there a way using just one of the developer tools for Chrome / Firefox / IE to see a list of events?

更新:我发现在较新的Chrome版本中,我有一个名为 EventListeners 的标签,但它似乎不允许轻松向下钻取所有直到事件源的方式,因为jQuery包装了原始的

Update: I found out that in the newer Chrome versions I have a tab called EventListeners but it seems it doesn't allow easy drill down all the way down to the source of the event, as jQuery wraps the original

推荐答案

FireQuery - http://firequery.binaryage.com/ 可让您查看绑定到元素的事件并深入了解它们

FireQuery - http://firequery.binaryage.com/ lets you see events bound to elements and drill into them

这篇关于使用Chrome开发工具/ Firebug / IE开发人员工具栏查找元素的附加/绑定事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆