From 1ceb5588207e4758adafa0daedcb04640ce67f52 Mon Sep 17 00:00:00 2001 From: sneedgroup-holder Date: Mon, 21 Oct 2024 22:14:14 +0000 Subject: [PATCH] Add script.js --- script.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 script.js diff --git a/script.js b/script.js new file mode 100644 index 0000000..99981c9 --- /dev/null +++ b/script.js @@ -0,0 +1,11 @@ +document.getElementById('calculateButton').addEventListener('click', () => { + const input = document.getElementById('siveInput').value; + const resultContainer = document.getElementById('resultContainer'); + + if (input) { + const primes = sive(input); + resultContainer.innerHTML = `

Prime Numbers:

${primes.join(', ')}

`; + } else { + resultContainer.innerHTML = `

Please enter a valid number.

`; + } +});