Skip to content

Commit cd0150a

Browse files
authored
Create Array01.html
1 parent 810fdae commit cd0150a

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

Example/Array/Array01.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<style>
8+
li{
9+
height: auto;
10+
width: auto;
11+
border: solid 1px black;
12+
float: left;
13+
padding-top: 10px;
14+
padding-bottom: 10px;
15+
padding-left: 15px;
16+
padding-right: 15px;
17+
background-color: bisque;
18+
border-radius: 20px;
19+
margin: 10px;
20+
}
21+
ul{
22+
list-style: none;
23+
}
24+
</style>
25+
<script>
26+
27+
function get_data(){
28+
data = ['java','c++','python','reactjs','jsp']
29+
// console.log(data)
30+
// console.log(data[1])
31+
32+
print_d = document.getElementById("print_data");
33+
34+
for (let index = 0; index < data.length; index++) {
35+
36+
print_d.innerHTML += "<li>"+data[index]+"</li>";
37+
38+
}
39+
}
40+
</script>
41+
</head>
42+
<body>
43+
<button onclick="get_data()">Get Data</button>
44+
<ul id="print_data">
45+
46+
</ul>
47+
</body>
48+
</html>

0 commit comments

Comments
 (0)