How to remove the first two BR tags with jquery?

前端 未结 6 1324
萌比男神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:36

    Also try nth-child.

    $("#system > br:nth-child(1), #system > br:nth-child(2)").remove();​
    

    removes first and second instance of br within #system

提交回复
热议问题