I have 3 tables – Table1 Table2 and Table3
I want to change this $('tr').filter to only effect Table2
Is this correct?
$('#Table2 tr').filter or is there any other way to do so?
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.
The best way to do it is using:
As noted by the documentation, the 2nd argument of the
$()function is a context selector that tells it where to look. By default that is the entire document, but you can specify something else, like a table:Although what you have will work, the above is the optimal way of doing it. Speed difference for your average use case will be insignificant, though. I just prefer specifying the context whenever possible.