如何使用jquery获取下拉列表框数组的选定值

时间:2011-07-16 07:55:31

标签: jquery

如何使用jquery获取下拉列表框数组的选定值? 我上传了我尝试过的代码。不适用于下拉。 提前感谢任何帮助或建议

2 个答案:

答案 0 :(得分:1)

下面是我使用jQuery(感谢jQuery注入附加组件)从表单项中获取所选值的截图。

简而言之:$("select option:selected").val()

demonstrating getting the selected value from a select

答案 1 :(得分:0)

$('select.foo option:selected').val(); // get the value from a dropdown select
相关问题