How to remove the first two BR tags with jquery?

前端 未结 6 1306
萌比男神i
萌比男神i 2021-01-13 05:14

I\'d like to remove only the first two BR tags with jquery.



// I want to remove both BR. ... <
6条回答
  •  无人及你
    2021-01-13 05:35

    Additionally if you only want to remove the last br only you can try;

    $('#elementID br:last').remove();
    

    Lets say that the br follows a , you can try

    $('#elementID strong+br:last').remove();
    

提交回复
热议问题