as an alternative, you could do something like:

jQuery(".class").click(function() {
    jQuery(this).toggleClass("highlighted");
})

then, in your CSS

.class a {
    color: black;
}
.class.highlighted a {
    color: red;
}

On Feb 26, 7:40 am, Tze Yang Ng <ngt...@gmail.com> wrote:
> Try the following:
>
> jQuery(".class").click(function() {
>   jQuery('a',this).toggleClass("highlighted");
>
> }
>
> Cheers
>
> ==
>
> On Thu, Feb 26, 2009 at 7:46 PM, Kenchu <sweken...@gmail.com> wrote:
>
> > Is there a way to do what I describe in topic?
>
> > For example.
>
> > jQuery(".class").click(function()
> > {
> >        jQuery(this + "a").toggleClass("highlighted");
> > });
>
> > This doesnt work. What im trying to do is to select all the <a>
> > elements within this. Is it possible to achive that somehow?
>
> --http://ngty77.blogspot.com

Reply via email to