Last active
December 20, 2022 09:58
-
-
Save abijaK/f76bcdc6d9cc6919855f3aa678c32676 to your computer and use it in GitHub Desktop.
Code Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declare variables to point to elements | |
let min = document.getElementById("min"); | |
let sec = document.getElementById("sec"); | |
let startButton = document.getElementById("start"); | |
let breakButton = document.getElementById("break"); | |
let resetButton = document.getElementById("reset"); | |
// Initialization | |
let initial = { | |
startTime: 24, | |
breakTime: 4, | |
seconds: "00", | |
} | |
// Switch on session/break | |
let timer; | |
let decrementSec = 59; | |
// Display on loading | |
window.onload = () => { | |
min.innerHTML = initial.startTime + 1; | |
sec.innerHTML = initial.seconds; | |
breakButton.style.display = "none"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment