jquery get the index of a row?
- by KnockKnockWhosThere
I'm trying to write a function that will do something if the the row index is 0, and then something else if the row index is greater than 0. The zero part is working, but I can't figure out the syntax for rows that have an index greater than 0.
For the tr[0] row, I'm doing this:
if($("#mytable > tbody > tr ").index(0)) {
...
I tried:
if($("#mytable > tbody > tr ").index() > 0 ) {
But, that didn't work?