JSFiddle - React, Tailwind, and code Playground
by brigand
JavaScript
let html = `
<div>
<div>text</div>
</div>
`
let element = makeElement(html)
console.log(element.childNodes.length) // how to make this 1 while writing the html per-line
// source: https://stackoverflow.com/a/35385518/12891895
function makeElement(innerHTML) {
var template = document.createElement('template');
template.innerHTML = innerHTML.trim();
let element = template.content.firstChild;
return element;
}