I have the following:
<div id="test">
...
...
</div>
I would like to remove all of the elements within the div so I tried:
$('#test > div').remove();
But this doesn’t seem to work. Am I doing the right thing here?
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.
try with right syntax
try with empty
see html() also, sometime it is helpful
Note: To remove the elements without removing data and events, use .detach() instead.