What is the best method for removing a table row with jQuery?
Advertisement
Answer
You’re right:
JavaScript
x
2
1
$('#myTableRow').remove();
2
This works fine if your row has an id
, such as:
JavaScript
1
2
1
<tr id="myTableRow"><td>blah</td></tr>
2
If you don’t have an id
, you can use any of jQuery’s plethora of selectors.