How come jQuery can't remove this element?
- by George Edison
I have a table like this:
<table id='inventory_table'>
<tr id='no_items_avail'>
<td>
There are no items in the database.
</td>
</tr>
</table>
And I want to get rid of it with jQuery like this:
$('#inventory_table tbody tr#no_items_avail').remove();
However it doesn't seem to be working at all. What am I doing wrong?
Edit: Also, the row above was originally inserted into the DOM with another jQuery call:
$('#inventory_table tbody').append("<tr id='no_items_avail'.......
If that helps. And, running:
alert($('#no_items_avail').text());
yields "There are no items in the database." as expected.