JSFiddle - React, Tailwind, and code Playground

HTML

<parent>
    <child>i want to keep the child</child>
Some text I want to remove
    <child>i want to keep the child</child>
    <child>i want to keep the child</child>
</parent>

JavaScript

var child = $('parent').children('child');

$('parent').html(child);