Crul
11-06-2008, 04:57 PM
I'm implementing an expand/collapse feature but I have a problem:
I have 2 rows in a table...
<table>
<tr id="40807386" class="hidden ">testing this</tr>
<tr id="34893485" class="hidden ">testing this again</tr>
</table>
So I can hide this row by going $('.hidden').toggle(); but this hides both the rows when I only want to hide the first row, not both. Is there a way to get the id of the element so that I can go something like ($(this).id).toggle() This ^ gives me an error but I need to be able to do something similar. Any help on this would be greatly appreciated
Thanks
I have 2 rows in a table...
<table>
<tr id="40807386" class="hidden ">testing this</tr>
<tr id="34893485" class="hidden ">testing this again</tr>
</table>
So I can hide this row by going $('.hidden').toggle(); but this hides both the rows when I only want to hide the first row, not both. Is there a way to get the id of the element so that I can go something like ($(this).id).toggle() This ^ gives me an error but I need to be able to do something similar. Any help on this would be greatly appreciated
Thanks