From d772fe806ede6cd986ee1e5858d39a84ea56726d Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Wed, 31 Jul 2024 04:03:49 +0200 Subject: [PATCH] display random tone value --- app.js | 13 ++++++++++++- index.html | 12 ++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index ec10f3e..4197614 100644 --- a/app.js +++ b/app.js @@ -1 +1,12 @@ -console.log('hi'); +const lowest = 27.5 +const highest = 4186 +const range = highest - lowest + +const generateButton = document.querySelector('body > button') +const toneDisplay = document.querySelector('section dd') +let newTone + +generateButton.addEventListener('click', () => { + newTone = Math.random() * range + lowest + toneDisplay.innerHTML = newTone +}) diff --git a/index.html b/index.html index abe16b7..86e791d 100644 --- a/index.html +++ b/index.html @@ -3,10 +3,18 @@ - +

Tuner

- + +
+
+
Tone:
+
+
+ + +