I'm trying to add a class to the first td inside a tr w/ a specific class. But for some reason it adds this class only to the first td in the first tr -not the first td in each tr
$("#appendTD").find("#gridFormInformation").children(0).children().each(
function() {
if ($("#appendTD").find('tr').filter(function() { return $(this).attr('class') == 'ui-widget-content ui-subtblcell'; }).children("td:eq(0)").addClass("leftbord"));
}
);
But when I alter the above by removing the ""td:eq(0)" it adds this class to each td in each tr ... so what am I doing wrong?
Example of the markup below
<td id="appendTD">
<table id="gridFormInformation">
<tbody>
<tr><th>1</th><th>2</th><th>3</th></tr>
<tr class="ui-widget-content ui-subtblcell"><td>1</td><td>2</td><td>3</td></tr>
<tr class="ui-widget-content ui-subtblcell"><td>1</td><td>2</td><td>3</td></tr>
<tr class="ui-widget-content ui-subtblcell"><td>1</td><td>2</td><td>3</td></tr>
</tbody>
</table>
</td>