1
<html>
2
<head>
3
<title> Demo </title>
4
<script language=javascript>
5
function deloption(){
6
var obj=document.getElementById("sel").options;
7
8
if (obj.length > 1){
9
obj.options.remove(obj.length - 1);
10
}
11
}
12
13
function addoption()
14
{
15
var obj=document.getElementById("sel").options;
16
var opt = new Option("newoption" + obj.length, obj.length );
17
obj.options.add(opt);
18
19
}
20
</script>
21
</head>
22
<body>
23
<select name="sel">
24
<option>one
25
</select>
26
<input type="button" onclick="addoption()" value="ADD">
27
<input type="button" onclick="deloption()" value="DEL">
28
</body>
29
</html>

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
