我有一个表在单独的列中包含许多对文本输入字段。我想遍历第一列中的输入字段,并使用这些值来设置相邻列中相应输入字段的值。同时在jQuery中对两组元素进行迭代
<table>
<tr>
<td><input type="text" class="left" /></td>
<td><input type="text" class="right" /></td>
</tr>
<tr>
<td><input type="text" class="left" /></td>
<td><input type="text" class="right" /></td>
</tr>
...
</table>
我刚开始学习jQuery,所以答案很明显。到目前为止,我只有
$("input.left").each(function() {
// use the value of $(this) to set the
// value of the text field to the .right
})
不知道这存在! – alex 2009-03-06 05:35:35