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've created a fiddle here.
var textInputs = $(':text'); alert('found ' + textInputs.length + ' textInputs'); var datas = textInputs.find('[data-foo]'); alert('found ' + datas.length + ' datas');
I'm finding the text elements, but my selector on the data attribute is returning no elements.
Ideas would be helpful...