Find All Elements That Have A Certain Data Attribute (regardless Of Value)
I have a form with a bunch of text elements, some of which have a data attribute set. I want to loop through all the elements that have that attribute, extracting the attribute. I'
Solution 1:
The [data-foo]
selector is correct, but you should use it in a filter
, instead of in a find
:
var datas = textInputs.filter('[data-foo]');
Post a Comment for "Find All Elements That Have A Certain Data Attribute (regardless Of Value)"