What is the best way to remove a table row with jQuery?

Darryl Hein picture Darryl Hein · Oct 4, 2008 · Viewed 549.4k times · Source

What is the best method for removing a table row with jQuery?

Answer

imjoevasquez picture imjoevasquez · Oct 4, 2008

You're right:

$('#myTableRow').remove();

This works fine if your row has an id, such as:

<tr id="myTableRow"><td>blah</td></tr>

If you don't have an id, you can use any of jQuery's plethora of selectors.