Skip to main content

Practice ยท 1 of 1

Render a List from Data

The document object in this challenge records what you build โ€” use it exactly like the real one: document.createElement(tag), document.querySelector(selector), and parent.appendChild(child). 1. Select the list with id "todo-list". 2. Loop over the given todos array (it is provided in the boilerplate) and for each item: create an <li>, set its text to the todo, and append it to the list.

Difficulty: intermediate

Back to lesson: Practice: Creating and Removing Elements โ€” Practice