怎样对 TR 中的 TD 中的 INPUT 取值、赋值?
怎样对 TR 中的 TD 中的 INPUT 取值、赋值?
怎么对下表中的 input 取值、赋值?<table>
<tr id="guest_1">
<td><input type="text" name="name" id="name" value="1111"></td>
<td><input type="text" name="weight" id="weight"></td>
</tr>
<tr id="guest_2">
<td><input type="text" name="name" id="name" value="2222"></td>
<td><input type="text" name="weight" id="weight"></td>
</tr>
<tr id="guest_3">
<td><input type="text" name="name" id="name" value="3333"></td>
<td><input type="text" name="weight" id="weight"></td>
</tr>
</table>
------解决方案--------------------
JScript codevar tr = document.getElementById("guest_1");var name = tr.childNodes[0].firstChild.value;var weight = tr.childNodes[1].firstChild.value;
查询谷 - www.chaxungu.com
怎样对 TR 中的 TD 中的 INPUT 取值、赋值?该怎么处理
编辑:chaxungu时间:2022-10-02 23:17:47分类:web开发