JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<div id="A">Hi</div>
<div id="B">Dude</div>
JavaScript
//remove element node
var divA = document.getElementById('A');
divA.parentNode.removeChild(divA);
//remove text node
var divB = document.getElementById('B').firstChild;
divB.parentNode.removeChild(divB);
//log the new DOM updates
console.log(document.body.innerHTML);