I’m looking for a way to select the all the divs which has a sub link element with a specific id.
Structure
<div>
<a href="#" id="123">link</a>
</div>
How do I select the div with jquery?
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.
You can use the
:hasdocs selector.as mentioned, you should not use numbers for ids. You can prefix them with something like
id_and remove that when you want the actual number.update
added the
>to the selector used by the:hasto only select the div that has the link as a direct child.