-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (21 loc) · 1.09 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function even_odd(num1,num2) {
document.getElementById("ev_odd_h3").style.display = "block";
for (; num1 < num2; num1+=2) {
var node = document.createElement("LI"); // Create a <li> node
var textnode = document.createTextNode(num1); // Create a text node
node.appendChild(textnode); // Append the text to <li>
document.getElementById("even_odd_result").appendChild(node);
}
}
function all_numbers(num1,num2) {
document.getElementById("all_h3").style.display = "block";
for (; num1 <= num2; num1+=1) {
var node = document.createElement("LI"); // Create a <li> node
var textnode = document.createTextNode(num1); // Create a text node
node.appendChild(textnode); // Append the text to <li>
document.getElementById("all_result").appendChild(node);
}
}
function alerts() {
alert("If you type an even you will recive even result & if you type an oll you will recive oll result.")
}