scrimba
Frontend Career Path
Making websites interactive
Chrome Extension
Add the <a> tag
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
Add the <a> tag
Expand for more info
index.js
run
preview
console
let myLeads = []
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)
inputEl.value = ""
renderLeads()
})

function renderLeads() {
let listItems = ""
for (let i = 0; i < myLeads.length; i++) {
// Wrap the lead in an anchor tag (<a>) inside the <li>
// Can you make the link open in a new tab?
listItems += "<li>" + myLeads[i] + "</li>"
}
ulEl.innerHTML = listItems
}
Console
/index.html
-4:28