Skip to main content

Practice · 2 of 3

Render a List from Data

CHALLENGE
Difficulty: beginner+25 XP

Given const todos = ["learn the DOM", "build a list", "render from data"] and the #todo-list element: create one li per todo (with createElement + textContent), and append each to the list. Rules: - Loop or forEach over the array. - Every li's text comes from the data.

Back to lesson: Practice: DOM Practice Gym