Parent selector in jquery

Posted by matthewsteiner on Stack Overflow See other posts from Stack Overflow or by matthewsteiner
Published on 2010-04-15T17:09:01Z Indexed on 2010/04/15 17:13 UTC
Read the original article Hit count: 149

Filed under:

I have a table row that needs to be hidden when the anchor with class "removerow" is clicked.

<tr><td>Product Name</td><td><a class="removerow">Remove</a></td></tr>

I've been trying this, but it doesn't work:

$("a.removerow").click(function(){
$(tr > this).hide();

});

How can I select the entire table row with a child of ".removerow".

What am I doing wrong?

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery