October 22, 2024
Chicago 12, Melborne City, USA
jQuery

Remove div inside parent div in jquery object only


I have a divs inside parent div:

<div id="parent">
  <div id="child">some content1</div>
  <div id="child">some content1</div>
</div> 

I get the parent div using jQuery:

var allDivs= $("#parent").html();

I want to remove child divs from this parent, how I can do this? Child divs should be deleted from jQuery object but not from DOM, is it possible?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video