I'm trying to navigate through each of the tr element and select the 5th td element then store the value in it. What am I doing wrong?
$("table tbody tr td tbody tr:nth-child(4)").each(function (i) {
alert(this.text);
});
<table>
<tbody>
<tr>
<td align="center"><table cellpadding="2" style="border: 2px solid rgb(208, 208, 208); border-spacing: 4px; border-collapse: collapse; background-color: rgb(240, 240, 240);">
<tbody>
<tr bgcolor="#e0e0e0">
<th>Seller</th>
<th>Feedback</th>
<th>Description</th>
<th>#</th>
<th>$</th>
<th/>
</tr>
<tr bgcolor="#e0e0e0">
<td><a href="http://www.foo.com/">test3</a> </td>
<td align="right"><a href="http://www.foo.com/User/1857/Feedback.html">+366</a> </td>
<td>Near Mint English</td>
<td align="right">8</td>
<td align="right">12.49</td>
<td><a href="http://www.foo.com/">Add to Cart</a> </td>
</tr>
<tr bgcolor="#f0f0f0">
<td><a href="http://www.foo.com/">test4</a> </td>
<td align="right"><a href="http://www.foo.com/User/637/Feedback.html">+1,257</a> </td>
<td>Near Mint English</td>
<td align="right">14</td>
<td align="right">13.58</td>
<td><a href="http://www.foo.com/">Add to Cart</a> </td>
</tr>
<tr bgcolor="#e0e0e0">
<td><a href="http://www.foo.com/">test5</a> </td>
<td align="right"><a href="http://www.foo.com/User/2989/Feedback.html">+2,062</a> </td>
<td>Very Fine English</td>
<td align="right">2</td>
<td align="right">13.99</td>
<td><a href="http://www.foo.com/">Add to Cart</a> </td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
Thank you!