如何从 jQuery 的下拉列表中获取值 [英] how to get the value from dropdownlist in jQuery

查看:17
本文介绍了如何从 jQuery 的下拉列表中获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网页中有一个下拉列表,如何从它们的选定选项中获取值

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.

我不是在谈论属性值",我需要一个值来填充下拉列表的选项标签

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 的下拉列表中获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆