scrimba
JavaScriptmas 2021 Day 18
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

JavaScriptmas 2021 Day 18
AboutCommentsNotes
JavaScriptmas 2021 Day 18
Expand for more info
index.js
run
preview
console
const items = [
{
name: 'Candles',
icon: '🧨'
},
{
name: 'Decorations',
icon: '🎄'
},
{
name: 'Chocolate',
icon: '🍫'
},
{
name: 'Socks',
icon: '🧦'
}
]

const checklist = document.getElementById("checklist")

for (let i = 0; i < items.length; i++) {
const { name, icon } = items[i]

checklist.innerHTML += `
<div class="checklist-item">
<input type="checkbox" id="${name}" value="${name}">
<label for="${name}" class="strikethrough">
<span class="custom-checkbox" data-icon="${icon}"></span>
${name}
</label>
</div>
`
}
Console
/index.html
LIVE