Add script.js
This commit is contained in:
parent
625cd814b0
commit
1ceb558820
1 changed files with 11 additions and 0 deletions
11
script.js
Normal file
11
script.js
Normal 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>`;
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in a new issue