Untitled

mail@pastecode.io avatar
unknown
plain_text
23 days ago
1.0 kB
2
Indexable
Never
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Shfaq numrat tek</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        #output {
            white-space: pre-line; /* Ensures that new lines are respected */
        }
    </style>
</head>
<body>

<h1>Odd Numbers</h1>
<button onclick="displayOddNumbers(1, 100)">Shfaq numrat tek nga 1 ne 100</button>

<div id="output"></div>

<script>
    function displayOddNumbers(start, end) {
        let outputDiv = document.getElementById('output');
        outputDiv.innerHTML = ''; // Clear previous output

        for (let i = start; i <= end; i++) {
            if (i % 2 !== 0) {
                let line = document.createElement('div');
                line.textContent = i;
                outputDiv.appendChild(line);
            }
        }
    }
</script>

</body>
</html>
Leave a Comment