I want to extra class name with every exist class. for example for now I have this scenario.
<table id="Table20">
<tr>
<td class="item">
<td class="item">
<td class="item">
<td class="item">
<td class="item">
</tr>
</table>
And I want to add an extra class with Jquery like this one:
<table id="Table20">
<tr>
<td class="item itm1">
<td class="item itm2">
<td class="item itm3">
<td class="item itm4">
<td class="item itm5">
</tr>
</table>
I were using that code but it does not work for me.
$('td.item').each(function(i,n){ $(n).addClass('count' + (i + 1));});
Please help.
Thank you