I have the following HTML table
<table>
<tr class="trSelected">
<td>One</td>
<td>two</td>
</tr>
</table>
I just want to get the text in the second column (ie,’two‘)
I tried
$('.trSelected td').eq(2).val()
but it returs an empty string
How it is possible through jQuery?
You should use the following construction:
or
eqselector uses zero-based index. Also you have to usetextmethod, notval.