Is there anyway to show a hidden div in the last row of a html table

Posted by oo on Stack Overflow See other posts from Stack Overflow or by oo
Published on 2010-03-24T04:22:03Z Indexed on 2010/03/24 4:33 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

i have an html table. here is a simplified version:

<table>
      <tr>
           <td><div style="display: none;" class="remove0">Remove Me</div></td>
      </tr>
      <tr>
           <td><div style="display: none;" class="remove1">Remove Me</div></td>
      </tr>
      <tr>
           <td><div class="remove2">Remove Me</div></td>
      </tr>
</table>

i have javascript that clicks on Remove Me in the last row and it deletes the html row using:

$(this).parents("tr:first").remove();

the issue is that when i remove this last row, i also want the "Remove Me" text to now show up on the second row (which is now the new last row). how would i show this div so that it would dynamically show the "remove me" from the new last row?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about asp.net-mvc