JSFiddle - React, Tailwind, and code Playground

HTML

<div id="parent">
    this is a textNode
    <!-- This is a comment --> 
    <p>this is a p element</p>
</div>

JavaScript

var parent = document.getElementById('parent');

[].forEach.call(parent.childNodes, function(el) {
    if ( el.nodeType === 8 ) {
       el.nodeValue = 'changed value';
    }
});