JSFiddle - React, Tailwind, and code Playground
HTML
<div class='parentDiv' id='pdiv'>Some text <span style='color:red;'>BBBBBBBBBBBBBBBBBBBBBBB</span> more example text more example <b style="color:green;">more</b> example text more example more example text more example more example text more example more example text example text example text example text example text example text example text example text example text example text
<div id='secondChild' style='color:blue;'>This div should be removed.</div>
</div>
<span class='Execute' onclick="removChild()"><b>Click me</b></span>
JavaScript
var removChild = function () {
document.getElementById('pdiv').removeChild(document.getElementById('secondChild'))
}