获取当前选中的表单option的值

来源:互联网 发布:淘宝开店零食起名字 编辑:程序博客网 时间:2024/06/04 19:30

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

获取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;//要的值

0 0
原创粉丝点击