How to remove all elements in a div after a certain div

后端 未结 5 1276
既然无缘
既然无缘 2021-01-20 04:31

So I have a div that is drawing in dynamic elements at its bottom and I want to hide these elements, no matter what their IDs are using javaScript/jQuery. Basically my HTML

5条回答
  •  無奈伤痛
    2021-01-20 05:27

    If only one div at a time is generated dynamically. Add this to dynamic generation:

    $('#the-form + div').hide();
    

    Another method to achieve the same (not preferred) is:

    $('#the-form').next('div').remove();
    

提交回复
热议问题