how do I use an id with :contains() selector?
possibly similar to this?
$("$("#foo"):contains('John')")
thank you
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.
Because
:contains()is a selector you have to use it together with the element/id/class you want, like so:EDIT:
Unless you want to search the whole document, as pointed by @gdoron, using the selector by itself is fine too