-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (22 loc) · 1.03 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
31
32
function even(num1,num2) {
document.getElementById("ev_h3").style.display = "block";
for (;num1<num2; num1++) {
if(num1%2==0){
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").appendChild(node);
}
}
}
function odd(num1,num2) {
document.getElementById("odd_h3").style.display = "block";
for (;num1<num2; num1++) {
if (num1%2!=0) {
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("odd").appendChild(node);
}
}
}