javascript|控制 1<html>
2<head>
3<title> Demo </title>
4<script language=javascript>
5function deloption(){
6 var obj=document.getElementById("sel").options;
7
8 if (obj.length > 1){
9 obj.options.remove(obj.length - 1);
10 }
11}
12
13function 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" value="ADD">
27<input type="button" value="DEL">
28</body>
29</html>
JavaScript控制ComboBox中Option的增加和删除(原)
80酷酷网 80kuku.com