From 1b47361a4747875da7e1c6b9c0970c4d652df0fd Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 30 Jun 2020 16:59:09 -0400 Subject: [PATCH] disabling buttons --- app.js | 4 ++++ index.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 858ff28..2b9b074 100644 --- a/app.js +++ b/app.js @@ -24,10 +24,14 @@ const displayTime = () => { document.querySelector('.btn-primary').addEventListener('click', (event) => { startTime=Date.now(); + document.querySelector('.btn-primary').disabled=true; + document.querySelector('.btn-secondary').disabled=false; windowInterval = window.setInterval(displayTime,1000) }) document.querySelector('.btn-secondary').addEventListener('click', (event) => { + document.querySelector('.btn-primary').disabled=false; + document.querySelector('.btn-secondary').disabled=true; window.clearInterval(windowInterval) }) diff --git a/index.html b/index.html index 3c943bc..44d4da1 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@
- +