Reputation: 8360
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 ?
< td >
< tr >
Upvotes: 59
Views: 82235
Reputation: 2914
$('#id td:nth-child(3)');
Like so for the 3rd.
Upvotes: 12
Reputation: 871
the eq api should do this for you
$("table td").eq(n)
Upvotes: 19
Reputation: 125496
using :nth-child() Selector
like
$("tr td:nth-child(2)")
Upvotes: 112