如何从jQuery中的dropdownlist获取值 [英] how to get the value from dropdownlist in jQuery
本文介绍了如何从jQuery中的dropdownlist获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的网页上有一个下拉列表,我可以从他们选择的选项中获取价值。
i have a dropdownlist in my web-page how i can get the value from the selected option of them
喜欢
<select id="selme">
<option id="a" value="1">I need it</option>
</select>
我可以在何时选择我需要它的值。
how i can get the value "I need it" whenver it will select.
我不是在谈论属性值我需要一个填写dropdownlist的选项标签的值
i not talking about attribute "value" i need a value who fill inside option tags of dropdownlist
推荐答案
尝试
$("#selme").change(function(){
$(this).find("option:selected").text();
});
查看 工作演示
这篇关于如何从jQuery中的dropdownlist获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文