Matt, >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')); >});
Try: $("a.addcomment").click( function (){ alert( $(this).parent().attr('className') ); }); -Dan