JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"><br/><br/>There's two &lt;br&gt; elements before this line.<br/><br/><button>click here to remove them</button></div>

JavaScript

$("button").click(function () {
    $("#test > br:lt(2)").remove();
});