jquery:

//获取选中的option的文本值
$("#id option:selected").text();  
$("#id").find("option:selected").text()

//获取select中option的被选中的value值
$("#id").val(); 
$("#id option:selected").val();
$("#id").find("option:selected").val()

js:

var sel=document.getElementById("id"); 
var index = sel.selectedIndex; // 选中索引
sel.options[index].value;//要的值
sel.options[index].text;//要的文本

 

相关文章:

  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-12-02
  • 2021-12-10
相关资源
相似解决方案