搜索事件的Jquery选择器 [英] Jquery Selector that search for events
本文介绍了搜索事件的Jquery选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要选择所有绑定点击事件的元素?是否存在这样的选择器?
I need to select all elements, that has binded "click" event? Is there such selector exists?
推荐答案
jQuery不支持本机,但您可以使用 hasEvent插件:
It is not supported natively by jQuery, but you can write your own custom selector using hasEvent plugin :
jQuery.expr[":"].click = "jQuery(a).hasEvent('click');";
$("a:click").doStuff();
编辑:
还有事件绑定选择器插件,它更完整,可以开箱即用,但也更大。
There is also the Event Bound Selector plugin which is more complete and works out of the box, but is also bigger.
这篇关于搜索事件的Jquery选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文