function setInnerHTML(el,content) { const fragment = (new DOMParser()).parseFromString(`
${content}
`, 'text/html', {includeShadowRoots: true}); (el instanceof HTMLTemplateElement ? el.content : el).replaceChildren(...fragment.body.firstChild.childNodes); }