我有一个包含 n 列的表,每列中有 n-2 个输入。我想遍历单列输入,但不知道如何选择它们。
问问题
50 次
1 回答
2
使用选择nth-child()
器。例如,要获取第三列输入:
$('#table-id td:nth-child(3) input')
请记住,根据 CSS 规范,nth-child()
它是 1-indexed。
于 2012-09-05T17:10:58.270 回答