JSFiddle - React, Tailwind, and code Playground

by gRoberts

HTML

<div><div id="mydiv">Important text here</div></div>

JavaScript

var el = document.getElementById('mydiv');
var text = el.innerText; //or el.innerHTML
    el.parentNode.innerHTML = text;