循环获取每个TD里的值,但是TD中包含INPUT类型的值无法获取

Tomato514 Tomato514 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区


function check_form()
{


//alert(jQuery("#tableList").children("tr").length);
// alert( jQuery("#tableList").find("tr").length);


//jQuery("#tableList tr").click(function()
jQuery("tr").each(function () {
var a = new Array();
var i = 0;
jQuery(this).children("td,input").each(function() {
// a[i] = jQuery(this).text();
alert(jQuery(this).text());


// i++;

})

})
}
</script>
</head>
<body>
<table border="1" id="tableList">
<tr>
<td width="50" class="auto">1.0</td>
<td class="auto" width="50"><b>1.1</b></td>
<td class="auto" width="50"><b>1.2</b></td>
<td class="auto" width="50"><b> <input type=text name="Remarks" class="BigInput" value="123"> </b></td>
</tr>
<tr>
<td width="50" class="auto"><b>2.0</b></td>
<td class="auto" width="50"><b>2.1</b></td>
<td class="auto" width="50"><b>2.2</b></td>
<td class="auto" width="50"><b> <input type=text name="Remarks" class="BigInput"> </b></td>
</tr>
<tr >
<td width="50" class="auto"><b>3.0</b></td>
<td class="auto" width="50"><b>3.1</b></td>
<td class="auto" width="50"><b>3.2</b></td>
<td class="auto" width="50"><b> <input type=text name="Remarks" class="BigInput"> </b></td>
</tr>
</table>
<input id="queryBtn" type="button" onclick="check_form();"value="开始查询">
</body>
只能得到alert ( 1.0 1.1 1.2 空 2.0 2.1 2.2 空 3.0 3.1 3.2 空)

这样循环除了IPNUT的值之外都能出来,有啥办法在里面加个选择器把IPNUT的值也给循环出来吗?


...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
Tomato514
JavaScript 87,984 成员 224,681 内容