scrimba
Note at 2:06
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
Note at 2:06
Expand for more info
index.js
run
preview
console
const body = document.getElementById("body")
const greeting = document.getElementById("greeting")
const christmasBtn = document.getElementById("christmas")
const snowBtn = document.getElementById("snow")

// Task:
//- Add the functionality to switch the theme between 'Christmas' and 'snow'.
christmasBtn.addEventListener('click', () => {
body.classList.remove("snow")
body.classList.add("christmas")
})
snowBtn.addEventListener('click', () => {
body.classList.remove("christmas")
body.classList.add("snow")
})
// Stretch goals:
// - Add more themes!
// - Allow the user to customise the themes.
// - Turn the radio buttons into a toggle switch.
Console
/index.html
LIVE