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

前端 未结 3 854
野的像风
野的像风 2020-12-13 12:43

How can I select nth < td > of a < tr > using jquery. Say, I want to select 3rd < td >

相关标签:
3条回答
  • 2020-12-13 13:00
    $('#id td:nth-child(3)');
    

    Like so for the 3rd.

    0 讨论(0)
  • 2020-12-13 13:01

    using :nth-child() Selector

    like

    $("tr td:nth-child(2)")
    
    0 讨论(0)
  • 2020-12-13 13:09

    the eq api should do this for you

    $("table td").eq(n)
    
    0 讨论(0)
提交回复
热议问题