How do i select everything BUT the element with an id?
<div id="test">
<p id="test"></p>
<p></p>
<p></p>
</div>
I want to be able to select the second and third
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’t have 2 elements with the id “test” but if the code was as follows:
then you could use
or
to select just the other two paragraphs.
See http://api.jquery.com/not/ for the documentation for the not() method (first option) or http://api.jquery.com/not-selector/ for the :not() selector (second option).
Note: this won’t select “everything” but rather the second and third paragraph elements. I assume that’s what you meant 🙂