Add script.js

This commit is contained in:
The Ghost of FOSS' Past 2024-10-21 22:14:14 +00:00
parent 625cd814b0
commit 1ceb558820

11
script.js Normal file
View file

@ -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 = `<h2>Prime Numbers:</h2><p>${primes.join(', ')}</p>`;
} else {
resultContainer.innerHTML = `<p>Please enter a valid number.</p>`;
}
});