Selecting all td elements in a row but the first one
Hi, all
I have the following code that works fine (except the show/hide animation for the rows is proving to be a pain to get working):
- $('tr.docRow')
- .hover(function() {
- $(this).toggleClass('hover').css('cursor', 'pointer');
- })
- .click(function() {
- // Show and hide the row after the row that was clicked on
- $(this).next().toggle();
- });
In the table this is for, I have a checkbox in the first cell in the row the user hovers and clicks on to expand the following row. I am trying to make it so that clicking the checkbox doesn't trigger the jQuery toggling action.
Here is a sample row in the table this is for. The complete row below is what the user clicks on, and the row after that (class="docClassesRow") is what is expanded on clicking the above row
- <tr class="docRow" bgcolor="#E7DDCC">
- <td align="center"><input type="checkbox" class="chkDeleteDoc" name="deleteDocs[]" value="7" /></td>
- <td>Document 1</td>
- <td>The first document in the list of items the user can see</td>
- </tr>
- <tr class="docClassesRow" bgcolor="#E7DDCC">
- <td>...
I tried adding :not(:first-child) to the selector:
- $('tr.docRow:not(:first-child)')
but that didn't work.
What am I missing/doing wrong?
Thanks for anyone's help!
____________________________________
f u cn rd ths u cn gt a gd jb n prgrmmng