I am using jQuery and I have the following HTML code:
<a href="/link" data-a='{"one":"sample1","two":"sample2"}' data-b="true">Title</a>
I would like to find the above link by using multiple attribute selectors but for/with specific values contained in data-*
attributes. That is, I can find the above link this way
selector = 'a[data-a][data-b]'
$(selector).bind(...)
but I would like to be more specific by finding links having data-a
and data-b
attributes and whose attribute data-a
contains the one
key.
How can I do that?