Select elements that i have previously set with jquery.data();
i.e. Select all elements with .data('myAttr') already been set.
SOLUTION
A jsfiddle to demostrate is Fiddle
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could do
this selects all elements which have an attribute
data-myAttrwhich is not equal to ” (so it must have been set); (only for elements that have their data attribute set in HTML not via jQuery)you could also use filter() (which works for data attributes set from jQuery)