JSFiddle - React, Tailwind, and code Playground

HTML

<div id="box">

text to be removed
    
    <a href="#">this must stay</a>

</div>

JavaScript

var $box = $('#box'),
    tags = $box.children();

$box.html(tags);