Building elements from data
Lesson 16 of 20 · Web.Micro
Keep data in an array and draw the page from it: the idea behind every modern framework.
document.createElement("li") makes an element that is not on the page yet. Fill it, then list.append(li) puts it in place.
Check yourself
What does document.createElement("li") do?
Do it in the browser: a real HTML, CSS and JavaScript tool, a short mission and instant feedback. No install.
Start this lesson — free