There is a table, how I can get tr (table row), if there consists at least one input element.
I tried like:
$('#tablename:contains(input)').closest('tr');
It doesn’t work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
is what you were looking for.
Read about the :has() selector.
:contains()will look for simple text, while:has()will look for elements that match the selector.Or the more efficient version: