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

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -