Hide table row onclick using jquery

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-12-28T04:28:19Z Indexed on 2010/12/28 4:54 UTC
Read the original article Hit count: 128

Filed under:
|
|

I have a bunch of table rows such as:

<tr>
  <td>cell1</td>
  <td>cell2</td>
  <td><a href="action.php">cell3</a></td>
</tr>
<tr class="notes_row">
<td colspan="6">
<ul class="message warning no-margin" id="notes_box">
<li>Notes here</li>
</ul>
</td>
</tr>
<tr>
  <td>cell1</td>
  <td>cell2</td>
  <td><a href="action.php">cell3</a></td>
</tr>

The class="notes_row" is only there if notes are present for the row above it. How can I hide the tr and if its there the tr with the notes_row class below it without affecting the other rows using jquery? So if someone clicked cell3 the tr that link is in is hidden then if there is a notes table row below it, it hides that as well.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about table