Select elements that i have previously set with jquery.data();
即 Select 已设置.data('myAttr')
的所有元素.
SOLUTION
演示的难度是100
Select elements that i have previously set with jquery.data();
即 Select 已设置.data('myAttr')
的所有元素.
SOLUTION
演示的难度是100
你可以
$('[data-myAttr!=""]');
这将 Select 属性data-myAttr
不等于""的所有元素(因此必须已设置);(仅适用于在HTML中而不是通过jQuery设置数据属性的元素)
you could also use filter() (which works for data attributes set from jQuery)
$('*').filter(function() {
return $(this).data('myAttr') !== undefined;
});