Skip to main content

Practice ยท 2 of 3

Render a List from Data

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.

Difficulty: beginner

Back to lesson: Practice: DOM Practice Gym