Removing Children of DIV after certain Number

后端 未结 5 474
庸人自扰
庸人自扰 2020-12-30 09:59

I have this HTML

5条回答
  •  我在风中等你
    2020-12-30 10:09

    You can do this

    $('.control div:nth-child(2)').remove();
    $('.control div:nth-child(3)').remove();
    $('.control div:nth-child(4)').remove();
    

    Or you can do this as well

    $('.control div:nth-child(1)').siblings().remove();
    

提交回复
热议问题