11 lines
453 B
JavaScript
11 lines
453 B
JavaScript
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>`;
|
|
}
|
|
});
|