javascript - Get eq( ) and nth-child of table -
i have following table:
<table id="some-table"> <thead> <tr> <th>name</th> <th>type</th> <th>ui status</th> <th>engine status</th> </tr> </thead> <tbody> <tr> <th>a</th> <th>1</th> <th></th> <th></th> </tr> <tr> <th>b</th> <th>2</th> <th></th> <th></th> </tr> </tbody> </table>
i want insert ui status table @ index.
$(#'some-table tbody tr').eq(0)
me row want how 3rd th
in tr
can update ui status.
any appreciated.
thanks.
you can chain calls find children in element:
$(#'some-table tbody tr').eq(0).find('th').eq(2)
you can use :eq
pseudo class in selector:
$(#'some-table tbody tr:eq(0) th:eq(2)')
Comments
Post a Comment