js,jquery获取下拉框选中的option

js获取select选中的值:

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

jQuery获取下拉框选中的option:

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

 

posted @ 2016-05-04 21:50  zhongJaywang  阅读(578)  评论(0编辑  收藏  举报