Sikau JavaScript · Day 47 · about 30 min
Creating elements Building lists from arrays.
Pages built by code Your social feed isn't written by hand in HTML — code builds each post from data. Today you'll create brand-new elements and add them to the page, often from an array.
createElement and append const list = document.querySelector("#list");
const item = document.createElement("li");
item.textContent = "Pani puri";
list.append(item); The rest of this lesson From an array explain Building richer elements explain Predict predict Add an item to a list order Your turn write code Challenge challenge Badge quiz quiz What you learned recap Continue this lesson free — run real code in your browser
Continue with GoogleSee all 68 lessons of JavaScript