JSFiddle - React, Tailwind, and code Playground

by cs09g

HTML

<div id="abc">
<!-- comment -->
<div id="other">

</div>
</div>

JavaScript

console.log(document.querySelector("#abc").innerHTML);

document.body.innerHTML = document.body.innerHTML.replace(/\<\!\-\- start html comment -\-\>((.|[\n|\r|\r\n])*?)\<\!\-\- end html comment -\-\>[\n|\r|\r\n]?(\s+)?/g, "");