JSFiddle - React, Tailwind, and code Playground

HTML

<div id="parent"> Some text
    <div>Child1</div>
    <div>Child2</div>
    <div>Child3</div>
    <div>Child4</div>
  </div>
<input type="button" value="alter text" />

JavaScript

$(function() {
  $('input[type=button]').one('click', function() {
    var cache = $('#parent').children();
    $('#parent').text('Altered Text').append(cache);
  });
});