I have a table that incorporates 50 identical
<tr>
<td>#</td>
<td>#</td>
<td>123123</td>
</tr>
...
and now I am able to get the value of a specific row like this
$("#tableId tbody tr").each(function(){
var a = $(this).children();
var arr =a[2].innerText; //get each row
a[2].innerText = statename // get the third cell in each row
});
In this case, statename is an object with 50 states names. All I want to do now is to substitute that 123123 to each state name inside the object. So that it looks like this:
<tr>
<td>#</td>
<td>#</td>
<td>Alabama</td>
</tr>
<tr>
<td>#</td>
<td>#</td>
<td>Alaska</td>
</tr>
<tr>
<td>#</td>
<td>#</td>
<td>Arizona</td>
</tr>
...
I tried to loop within the jQuery but it did not work. Please help, thank you very much.