mirror of
https://github.com/LucasVbr/chronometer.git
synced 2026-05-16 17:12:06 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/* Get all elements */
|
||||
const element = document.getElementById('time-value');
|
||||
const startButton = document.getElementById('start-button');
|
||||
const stopButton = document.getElementById('stop-button');
|
||||
const clearButton = document.getElementById('clear-button');
|
||||
|
||||
/* Create a new Chronometer */
|
||||
const chrono = new Chronometer(element);
|
||||
|
||||
/* Define actions of buttons */
|
||||
startButton.addEventListener("click", () => {
|
||||
chrono.start()
|
||||
});
|
||||
|
||||
stopButton.addEventListener("click", () => {
|
||||
chrono.stop()
|
||||
});
|
||||
|
||||
clearButton.addEventListener("click", () => {
|
||||
chrono.clear()
|
||||
});
|
||||
Reference in New Issue
Block a user