const foo1 = {"key":"<h1>Hello</h1>"} // valid
const foo2 = {"key":"<h1 id="zzz">Hello</h1>"} // invalid
const foo3 = {"key":"<h1 id=\"zzz\">Hello</h1>"} // valid
function textNodesUnder(el){
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_ELEMENT,null,false);
while(n=walk.nextNode()) a.push(n);
return a;
}
textNodesUnder(document.body)