`
lupingui
  • 浏览: 157343 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

JS 操作 Select

 
阅读更多

添加

Select.options.add(new Option(text, value));

删除

Select.options[index] = null;

删除被选择的

Select.options[Select.selectedIndex] = null;

删除所有

Select.options.length = 0;

得到某个的显示信息及值

Select.options[index].text;

Select.options[index].value;

得到被选择的显示信息及值

Select.options[Select.selectedIndex].text;

Select.options[Select.selectedIndex].value;

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics