原生js方法:
var myselect=document.getElementById("test"); var index=myselect.selectedIndex;
var value=myselect.options[index].value;

jquery方法:
  var options=$("#test option:selected");
   options.val();//获取value
   options.text();//获取文本

相关文章:

  • 2021-03-29
  • 2021-12-10
  • 2021-06-19
  • 2021-12-10
  • 2021-11-21
  • 2021-11-22
  • 2021-12-10
猜你喜欢
  • 2021-12-10
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案