option操作小结
1在select列表第一行增加一个option的方法 方法1.document.getElementById("sel").add(new Option("1","1"),0);
方法2var y=document.createElement('option'); y.text='2'; y.value='2'; document.getElementById("sel").add(y,0); //0为索引号
2在select列表第一行修改一个option的方法,注意是覆盖 document.getElementById('selectId').options[0] = new Option("1","1");
3在select列表删除一个option的方法 document.getElementById("sel").remove(0);//0为索引号