I think if in jQuery you can select elements by named attributes using AND and OR.
Example:
<div myid="1" myc="blue">1</div> <div myid="2" myc="blue">2</div> <div myid="3" myc="blue">3</div> <div myid="4">4</div>
I would like to highlight all elements where myc="blue" , but only those whose myid set to 1 or 3.
So I tried:
a=$('[myc="blue"] [myid="1"] [myid="3"]');
but it does not work, same thing:
a=$('[myc="blue"] && [myid="1"] || [myid="3"]');
Is this possible without writing special filter functions?
operators jquery jquery-selectors find
The Bndr May 21 '12 at 2:25 pm 2012-05-21 14:25
source share