How do I turn this, which uses two calls two children:
$('#id tr').children('td').children('input')
into something that calls children only once? I am trying to select every input text box inside a particular table row (tr) that’s a child of #id. I’ve tried
$('#id tr').children('td input')
and
$('#id tr').children('td > input')
But neither of those work. I’m kinda new to these selector expressions, so sorry if it’s obvious.
Although I like the
$("#id tr td input")suggestions, in some cases (e.g. if you had the$("#id tr")object from some other source) you might instead be looking for.find(), which goes multiple levels deep (instead of.children()which only goes one):