select标签的使用
Javascript获取select下拉框选中的的值
jquery方法(前提是已经加载了jquery库)
1:var options=$("#test option:selected"); //获取选中的项
2:alert(options.val()); //拿到选中项的值
3:alert(options.text()); //拿到选中项的文本
select标签的使用
Javascript获取select下拉框选中的的值
jquery方法(前提是已经加载了jquery库)
1:var options=$("#test option:selected"); //获取选中的项
2:alert(options.val()); //拿到选中项的值
3:alert(options.text()); //拿到选中项的文本
转载于:https://my.oschina.net/u/1450300/blog/369371