scrimba
Note at 0:01
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 0:01
Expand for more info
index.js
run
preview
console
const countdownDisplay = document.getElementById("countdown-display")

function renderCountdown(){
const christmas = 25
// Task:
// - Get today's date (you only need the day).
const currentDate = new Date().getDate()
// - Calculate remaining days.
const remainingDays = christmas - currentDate - 1 // to show 0 on 12/25
// - Display remaining days in countdownDisplay.
document.getElementById('countdown-display').innerText = remainingDays
}

renderCountdown()

// Stretch goals:
// - Display hours, minutes, seconds.
// - Add a countdown for another festival, your birthday, or Christmas 2022.
Console
/index.html
LIVE