0
Does anyone know why when you create an HTML component using Template literals it always returns null? ex: I created a list and I want to take the li to put an event, but always returns null, since it exists in DOM.
const $container = doc.querySelector('[data-js="container"]');
const $categorie = doc.querySelectorAll('[data-js="categorie"] li');
const markup = `
<ul data-js='categorie'>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
`;
$container.innerHTML = markup;
Note: The list becomes a nodeList and you could transform into array like with the Feature of the es6 the Array.from() without problems, but Zica is that the element created by the literals template does not exist in the DOM.
– paulo roberto Costa