jquery怎么获取table中的某个td的值
<table border="1" cellspacing="0" id="mytable">
<thead>
<caption>统计表</caption>
</thead>
<tbody>
<tr>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>籍贯</th>
</tr>
<tr>
<td>1</td>
<td>张三</td>
<td>男</td>
<td>22</td>
<td>北京</td>
</tr>
<tr>
<td>2</td>
<td>李四</td>
<td>男</td>
<td>23</td>
<td>上海</td>
</tr>
<tr>
<td>3</td>
<td>王燕</td>
<td>女</td>
<td>21</td>
<td>广东</td>
</tr>
<tr>
<td>4</td>
<td>王伟</td>
<td>男</td>
<td>20</td>
<td>陕西</td>
</tr>
<tr>
<td>5</td>
<td>张娟</td>
<td>女</td>
<td>23</td>
<td>重庆</td>
</tr>
</tbody>
</table>
<script>
$(function(){
var name=$("#mytable tr>td:nth-child(2)").text();
var age=$("#mytable tr>td:nth-child(3)").text();
alert(name);
alert(age);
});
</script>