jQuery对象禁用事件监听器,如何检测,当HTML属性的变化 [英] jQuery object disabled event listener, how to detect when a html attribute changes
本文介绍了jQuery对象禁用事件监听器,如何检测,当HTML属性的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要为选择
标记事件侦听器。应该引起任何时候元素变为禁用
或启用
。
I need to make an event listener for a select
tag. It should be triggered any time the element becomes disabled
or enabled
.
这甚至可能吗?
P.S:的onchange
不检测禁用。
P.S.: onchange
does not detect disabling.
推荐答案
它使用这个jQuery .watch
插件是可能的。
It is possible using this jquery .watch
plugin.
http://darcyclarke.me/development/detect-attribute-changes -with-的jQuery /
插件检测对CSS的变化,但我编辑它此的jsfiddle 来为属性的工作。
The plugin detects for css changes, but i edited it in this JSfiddle to work for attributes.
这篇关于jQuery对象禁用事件监听器,如何检测,当HTML属性的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文