I started learning jquery few days ago and now i'm facing one problem in retrieving values from table using jquery
<table id="tblsample">
<tr>
<td id="1">Data one</td>
<td id="2">Data two</td>
</tr>
<tr>
<td id="3">Data one</td>
<td id="4">Data two</td>
</tr>
<tr>
<td id="4">Data one</td>
<td id="5">Data two</td>
</tr>
.
.
.
</table>
if i click on the first tr row i want to read "2"
<td id="2">Data two</td>
This is for binding a dropdown based on value.
for first td's i did something like below only for reading the text part
$('#tblsample tr td').click(function () {
var cval = $(this).text();
$(txtCountry).val(cval);//Binding to textbox - "Data One"
});
How can i take the id's of second td's for each tr.