10
I have a div that uses two CSS classes. Here is the HTML :
<div class="box1"></div>
<div class="box1 destaque"></div>
<div class="box2"></div>
<div class="box2 destaque"></div>
<div class="box3"></div>
I want to select the div
classy box1
and destaque
(in my example the second div) only.
What I’ve already tried :
If I do : $('.box1')
I select the two Divs with class box1
. It’s not what I want.
And if I do : $('.destaque')
I just selected a div with box1
and another with box2
(what I don’t want)
I’ve tried to $('.box1 .destaque')
but does not select anything.
So how do I mount the jQuery selector to fetch the Divs that use the classes box1 and highlight?
Uhul! I thought it was something simple. Thanks!
– Guilherme de Jesus Santos