The below is supposed to get the nth row from a table with the .graphedRow class. It works for the first row, but not the others.
$('#someTable tbody .graphedRow').eq(pointIndex+1).css('background-color', '#FEFF9F');
Though it should be noted that
eq() starts from 0 for index.
Did a bit of testing in Firebug.
:nth-child is slightly faster than
.eq() in this case. (Hundredths of a ms faster)
:nth-child was working fine, but it bases its index on all children of
#someTable tbody. It just returns those with the class
So looking at your JSFiddle, you have 6
<tbody> three of which have the class
.graphedRow (That would be the 1st, 4th and 6th
:nth-child(6), would select those.
:nth-child's index still increases due to the other children of
#someTable tbody (the Other
<tr> that don't have the class)
.eq()'s index is based on however many instances of
.graphedRow appear within