I have 2 div like this:
<div id="container1"><input class="1"><input class="2"></div>
<div id="container2"><input class="1"><input class="1"><input class="2"></div>
Now how do I remove all class=”1″ but only from the container2.
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.
This should do it.
$('#container2 .1').remove();This seeks all descendants from the element with id “container2” which belongs to the class named “1” and then remove them from the DOM.