childNodes includes whitespace, so the first one is a text node.
Acceptance criteria
- 1.#out should show item A.
childNodes includes whitespace, so the first one is a text node.
const first = document.getElementById("list").childNodes[0]; document.querySelector('#out').textContent = first.textContent.trim() === "" ? "got blank text" : "item " + first.textContent;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.