scrimba
Frontend Career Path
Making websites interactive
Chrome Extension
Create the render function
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Create the render function
Expand for more info
index.js
run
preview
console
let myLeads = ["www.awesomelead.com", "www.epiclead.com", "www.greatlead.com"]
const inputEl = document.getElementById("input-el")
const inputBtn = document.getElementById("input-btn")
const ulEl = document.getElementById("ul-el")

inputBtn.addEventListener("click", function() {
myLeads.push(inputEl.value)
console.log(myLeads)
// 2. Call the renderLeads() function
})

// 1. Wrap the code below in a renderLeads() function
let listItems = ""
for (let i = 0; i < myLeads.length; i++) {
listItems += "<li>" + myLeads[i] + "</li>"
}
ulEl.innerHTML = listItems

Console
/index.html
-2:00