I have a very simple table with two rows.
I thought the best way to get the value from TD with id is "row2".
<Table id="testing>
<tr>
<th>
</th>
<td id="row1">hello</td>
</tr>
<tr>
<th>
</th>
<td id="row2">world</td>
</tr>
</table>
Here is my attempt:
$(document).ready(function(){
var r=$("#testing":row2).val();
alert(r);
});
But I did not see the message appear. What should I do in jQuery code if I want to specify a table id along with a TD id?
var r=$("#testing":row2).text();
var r=$("#testing").children("row2").text();
source
share