admin管理员组文章数量:1356855
Is there a standard way to know that jQuery
plugin already initialized at specific HTML element?
I want to make some actions if for example select
element is under Chosen plugin.
Is there a standard way to know that jQuery
plugin already initialized at specific HTML element?
I want to make some actions if for example select
element is under Chosen plugin.
2 Answers
Reset to default 9$("#elementId").data("chosen");
This will return the chosen object assigned to the element, or undefined if not assigned.
Note: For other plugins or JQuery versions I worked with, you may need to check the plugin name suffixed with "Obj":
$("#elementId").data("pluginNameObj");
use this $('select#elementID').attr('data-rel');
if it gives you the value "chosen" then the select
element is under chosen plugin.
本文标签: javascriptHow to identify that Chosen plugin initialized on elementStack Overflow
版权声明:本文标题:javascript - How to identify that Chosen plugin initialized on element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743964271a2569598.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论