2011-03-07 51 views

回答

5
$('table[class="services"] tr td:nth-child(3), table[class="services"] tr td:nth-child(2)') 
+0

我猜它选择第二和第三列所有行,如果我要选择的第一行的只有第二列,我该怎么办呢?我试过这样的事情:$(“#ChallanGrid tr:eq(1)td:(3)”),但它不起作用。 –

2

你可以把它分解,避免选择的第一部分的重复:

$('table.services tr td').filter(':nth-child(2), :nth-child(3)') 

还要注意的是table.services是“正确”的方式,通过类CSS选择!

1

你可以这样做:

$('table.services tr td:nth-child(2), table.services tr td:nth-child(3)') 
相关问题