Worked great- thanks!

On May 25, 8:29 am, "Juan G. Hurtado" <[EMAIL PROTECTED]>
wrote:
> I think you should use "parent" as a function, with the ():
>
> alert($(this).parent().attr('class'));
>
> El 25/05/2007, a las 14:12, Matt W escribió:
>
>
>
> > Hi folks,
>
> > I started working with jQuery for the first time yesterday- and I've
> > got something that I'm hoping you all may be able to help me figure
> > out.
>
> > I would think that this (simple?) bit of code would 1) find all the
> > <a> tags with class "addcomment", and then 2)assign an onClick that
> > would create an alert box displaying the class of the containing
> > block. But the second to last line with the alert doesnt seem to be
> > working. Any help is appreciated.
>
> > Thanks,
> > Matt
>
> > $("a").filter(".addcomment").click(function() {
> >      alert($(this).parent.attr('class'));
> > });

Reply via email to