2011-03-07 52 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)') 
相關問題