//添加
var Select1= document.getElementById("Select1");
1.Select1.options[0]=new Option('a','0');

2.Select1.options.add(new Option('a','0'));
其中1的options[0],0是索引,所以好一点
//获取当前的value值
var www=Select1.value;
//获取当前的text值
var w=Select1.options[Select1.selectedIndex].text;
//动态删除select中的所有options
Select1.options.length=0;
//动态删除select中的某一项option:
Select1.options.remove(indx); 
//获取value
Select1.options[Select1.selectedIndex].value
//获取value
Select1.options[Select1.selectedIndex].text

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-04-21
猜你喜欢
  • 2021-12-23
  • 2021-12-04
  • 2022-01-25
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案