Reputation: 34471
I have a table with n columns, and n-2 inputs in each column. I want to iterate over a single column of inputs, but can't figure out how to select them.
Upvotes: 0
Views: 59
Reputation: 360046
Use the nth-child()
selector. For example, to get the third column of inputs:
$('#table-id td:nth-child(3) input')
Remember that, in accordance with the CSS spec, nth-child()
is 1-indexed.
Upvotes: 2