我喜欢这个 -选择从位于特定行表中的文本输入
<table class='table'>
<tr>
<td class="td"><input type="text" name="name<%=f.getId()%>" value="<%=f.getName()%>"/>
</td>
<td class="td"><input type="text" id="field_length" size="3" name="length<%=f.getId()%>" value="<%=f.getLength()%>"/></td>
<td class="td"><input type="text" name="tooltip<%=f.getId()%>" value="<%=f.getToolTip()%>"/></td>
</tr>
<tr>
same like the previous.......
</tr>
<tr>
same like previous....
</tr>
表现在我想在位于第二排id为“FIELD_LENGTH”文本框中更改值。我试图用jQuery来做到这一点。
$(‘tr:nth-child(2) input:text#field_length’).val(10);
但这不起作用。任何机构可以为我提供一些帮助。
只需使用'id'选择输入,如果你有相同'id'你有无效的HTML多种元素,并应纠正。 – 2012-08-08 09:42:36