开发者

how to select n-th td of a tr using jquery

How can I select nth < td > of a < tr > using jquery. Say, I want to select 3rd <开发者_运维问答 td >. I have id for every tr. How can we achieve this ?


using :nth-child() Selector

like

$("tr td:nth-child(2)")


the eq api should do this for you

$("table td").eq(n)


$('#id td:nth-child(3)');

Like so for the 3rd.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜