[jQuery] Re: Targeting an element with multiple classes

2008-07-02 Thread jez_p

Cheers Carl. I resolved this in an earlier post (I reposted due to the
post-appearing lag, and then not seeing my original post) - I had
tried this first, but couldn't get it to work due to a stupid mistake.
Thanks anyways.

On Jul 2, 9:44 pm, Carl Von Stetten <[EMAIL PROTECTED]> wrote:
> 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:
>
> > blah blah blah
> > blah blah blah
> > blah blah blah
>
> > 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.


[jQuery] Re: Targeting an element with multiple classes

2008-07-02 Thread Carl Von Stetten

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:
>
> blah blah blah
> blah blah blah
> blah blah blah
>
> 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.
>
>
>