I’m trying to target attributes names which contains a certain word & not in the kind of way you’re thinking.
Lets say I have:
<div data-foo-bar="hello"></div>
How can I target elements which have 'data-foo' in the attribute name?
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.
I don’t think you can target attribute names the same way you target attribute values. You can, however, use
.filter()to do this somewhat efficiently:Notice that
data-foo-barhas been converted tofooBar.Demo: http://jsfiddle.net/Tyj49/3/