jq与js获取select选中的值

获取选中的option的文本值

          $("#s option:selected").text();  //

获取select中option的被选中的value值,

           $("#s").val();

           $("#s option:selected").val();

js获取select选中的值:

          var sel=document.getElementById("select1"); 

          var index = sel.selectedIndex; // 选中索引

          albumid= sel.options[index].value;//要的值

猜你喜欢

转载自blog.csdn.net/rookie_is_me/article/details/80732974