I am using JQuery to iterate through all TRs in a table,
but not all rows have values in the first cell.
<TR>
<TD>3</TD>
<TD>2</TD>
<TD>1</TD>
</TR>
<TD></TD>
<TD>3</TD>
<TD>2</TD>
<TR>
</TR>
<TR>
<TD></TD>
<TD></TD>
<TD>3</TD>
</TR>
How can i target the first TD in each row that is not empty and not just the first child?
Thanks!
Here’s a simpler, more elegant solution:
Fiddle: http://jsfiddle.net/dandv/JRcEf/
It just says in jQuery what you mean: “target the first
tdin eachtrthat is not empty”.