jez_p

Try $('.green')

This will select only elements that have the "green" class assigned, 
even if other classes are also assigned to the same elements.

Carl

jez_p wrote:
> How do I target a specific class when elements may belong to multiple
> classes?
>
> For example:
>
> <p class="big red">blah blah blah</p>
> <p class="big green">blah blah blah</p>
> <p class="small green">blah blah blah</p>
>
> How would I select the elements with the class of "green"?
>
> I know that
>
> 'p[class="big green"]'  &
> 'p[class="small green"]'
>
> would work, but I cannot work out how I can just specify wherever
> there is a class of "green", and not have to include the other classes
> also.
>
> Thanks in advance.
>
>
>   

Reply via email to