JSFiddle - React, Tailwind, and code Playground
HTML
<!-- hello -->
Some comment before and after this
<!-- goodbye -->
<button>Show comments</button>
JavaScript
$("button").click(function () {
$("*")
.contents()
.filter(function(){ return this.nodeType == 8;})
.each(function(){ alert(this.nodeValue);});
});