-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram1.html
More file actions
61 lines (47 loc) · 2.23 KB
/
Copy pathprogram1.html
File metadata and controls
61 lines (47 loc) · 2.23 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
51
52
53
54
55
56
57
58
59
60
61
<html>
<head>
<title> Radio button example</title>
<script>
function updateList(ElementValue)
{
with(document.forms.myform)
{
if(ElementValue == 1)
{
optionList[0].text = "mango";
optionList[0].value = 1;
optionList[1].text = "Banana";
optionList[1].value =2;
optionList[2].text = "apple";
optionList[2].value = 3;
}
if(ElementValue == 2)
{
optionList[0].text = "potato";
optionList[0].value = 1;
optionList[1].text = "cabbage";
optionList[1].value =2;
optionList[2].text = "Onion";
optionList[2].value = 3;
}
}
}
</script>
</head>
<body>
<form name = "myform" action = "" method = "post">
<p>
<select name = " optionList" size = "2">
<option value =1>mango</option>
<option value =3>apple</option>
<option value =2>Banana</option>
</select>
<br>
<input type = "radio" name = "grp " value=1 checked =true onclick="updateList(this.value)">fruits</input>
<input type = "radio" name = "grp " value=2 onclick="updateList(this.value)">vagitable</input>
<br>
<input name ="reset" value = "reset" text ="reset">
</p>
</form>
</body>
</html>