javascript - How to get an element by data attribute when there are multiple values for the same attribute? -
how element data attribute when there multiple values same attribute ?
<a data-multiplevalues="valuea valueb valuec">test</a> $("a[data-multiplevalues='valuea valueb valuec']") - works $("a[data-multiplevalues='valuea']") - doesn't work
any ideas?
for [data-multiplevalues='valuea']
attribute has equal value, if want select element attribute contains white space separed values can use
a[data-multiplevalues~='valuea']
see http://www.w3.org/tr/selectors/#attribute-selectors more
Comments
Post a Comment