html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p id="regularArray" onclick="regularArray()">Click here to Iterate Through an Array with a For Loop</p>
<p id="evenArray" onclick="evenArray()">Click here to Iterate Through an Even Array with a For Loop</p>
<p id="oddArray" onclick="oddArray()">Click here to Iterate Through an Odd Array with a For Loop</p>
<p id="revArray" onclick="revArray()">Click here to Iterate Through an Reverse Array with a For Loop</p>
<p id="modArray" onclick="modArray()">Click here to Iterate Through an Module Array with a For Loop</p>
<p id="powArray" onclick="powArray()">Click here to Iterate Through an Power Array with a For Loop</p>
<!--This footer section is content at the bottom -->
<footer>Copyrights not reserved © 2017. Education purpose , copy as you like. <a href="https://www.sololearn.com/Profile/1685562/?ref=app">Melic</a></footer>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
body {
}
p{
font-size: 14px;
color: #0cadde;
border-style: solid;
border-radius: 15px;
padding: 5px;
}
footer{
position: absolute;
width:97%;
bottom: 30px;
clear: both;
background-color: #f1f1f1;
color: black;
padding: 2px;
text-align:center;
}
Enter to Rename, Shift+Enter to Preview
js
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
window.onload = function() {
alert("Thanks for visiting my codes;if you find my codes useful please upvote so many other people will notice them");
}
//Iterate Through an Array with a For Loop
function regularArray(){
var myArray = [];
for (i=0;i<10;i++){
myArray.push(i);
}
document.getElementById("regularArray").innerHTML = myArray;
}
//Iterate Through an Even Array with a For Loop
function evenArray(){
var myArray = [];
for (i=0;i<10;i+=2){
myArray.push(i);
}
document.getElementById("evenArray").innerHTML = myArray;
}
//Iterate Through an Odd Array with a For Loop
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run