-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray.html
More file actions
50 lines (49 loc) · 1.27 KB
/
array.html
File metadata and controls
50 lines (49 loc) · 1.27 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=">
<title>Array</title>
</head>
<script>
function array(){
a=["harry","vinayak","Vinay",'sunita','rajpal','raju']
y=document.getElementsByTagName("input")
for(i=0;i<6;i++){
y[i].value=a[i]
}
}
function arrayy(){
b=document.getElementById("x1").value
c=document.getElementById("x2").value
d=document.getElementById("x3").value
e=document.getElementById("x4").value
f=document.getElementById("x5").value
array=[b,c,d,e,f]
for(i of array){
document.write("Hello "+i)
document.write("</br>")
}
}
</script>
<body>
<h1>Arrays in HTML</h1>
<p>Technology in JavaScript</p>
<input type="text" >
<input type="text" >
<input type="text" >
<input type="text" >
<input type="text">
<input type="text">
<button onclick="array()">See the Magic
</button>
<hr>
<h2>project 2</h2>
<input type="text" id="x1">
<input type="text" id="x2">
<input type="text" id="x3">
<input type="text" id="x4">
<input type="text" id="x5">
<button onclick="arrayy()">Click me</button>
</body>
</html>