Javascript / JQuery - How to get count of specific child elements

I want to get the number of all TR elements that have an input element in them. How can I proceed?

Html:

<tbody> <tr> <td>Ignore this item 1</td> </tr> <tr> <td>Ignore this item 2</td> </tr> <tr> <td><input blablabla>... Include this TR...</td> </tr> </tbody>

Thanks!

+2


a source to share


1 answer


$('tr:has(input)').length



+5


a source







All Articles