Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$.each($('input[value|="Disable Login"]'), function() { alert(this.data('id')); });
给
“未捕获的类型错误:对象 # 没有方法‘数据’”。
您可能正在寻找:
$('input[value|="Disable Login"]').each(function(){ alert($(this).attr("id")); });
此外,您可以考虑将其应用于文档的子部分。像这样 :
$('input[value|="Disable Login"]',$("#myform")).each(function(){ alert($(this).attr("id")); });