这个只能选第一个节点,我把first换成sixth也不好使
<script type="text/javascript">
$(document).ready(function(){
$("tr td:first-child").each(function(){
alert($(this).text());
if($(this).text()==undefined){
alert("修改内部数值");
}
});
});
</script>
$("tr td").eq(6);这样可以,或者var i = 0;$("tr td").each(function(){
if(i==5){$(this).val();}i++;})
不如写在php里 定义一个函数 做一个>=6的判断
$("tr td").each(function(index){
if(index == 5){
}
});
或
$("tr td:eq(6)");
0 | 2 | 3 | 4 | 5 | 6 |
楼主你真会搞。。自己整个jquery的选择器出来,用:nth-child(6)
$("tr td:nth-child(6)").each(function(){
$("tr td:eq(5)").each()