I need to remove div elements that are dynamically loaded between two static div elements.
HTML
<div id="defaultFirst"> </div> .. .. .. <div id="defaultLast"> </div>
There are several div elements that are loaded between these two static div elements. Now I need to remove them before adding some other elements.
I tried using $('#defaultFirst').nextAll('div').remove() but also removed the #defaultLast element.
I know I can get the dynamic div ids and delete. But I need to know if there is an easier way to remove these dynamic div elements?
iamCR source share