jquery获取select中的option的text值
来源:互联网 发布:尔雅网络通识课程 编辑:程序博客网 时间:2024/05/18 01:26
<select id="ddd">
<option id="22">fdsfds</option>
<option id="12">fdsfds</option>
<option id="32">哈哈</option>
<option id="42">嘻嘻</option>
</select>
1.你的option中没有设置value,取不到值。如果设置了,$("#22").val()
2.要取到fdsfds这个值,用$("#22").html()
$(function(){
$('select').bind('change', function () {
$(this).val(); 是获取当前选中项的vlue值(或可以写成$('#ddd').val())
$(this).text() //将会得到全部的text值
$('select option:selected').text(); //将会得到选中的text值
$('#ddd option:selected').text(); //将会得到选中的text值
})
})
4.. checkbox 是按name属性分组的.
2. $(“:checkbox”)可以获取页面所有checkbox, $(“#radio”)
获取页面所有radio空间。
原文:http://blog.csdn.net/jingmeifeng/article/details/7362112
- jquery获取select中的option的text值
- jquery获取select中的option的text值
- jquery获取select中的option的text值
- jquery获取select中的option的text值
- jquery select option 根据value值获取text文本,option中间的文本
- jquery获取select中的option的text值|| PHP图片缩放函数:实现等比例不失真缩放
- jquery获取select中已经选择的option中的text文本
- jQuery获取Select option 选择的Text和Value
- jQuery获取Select option 选择的Text和 Value(转)
- jQuery获取Select option 选择的Text和Value
- jQuery获取Select option 选择的Text和 Value(转)
- jQuery获取Select option 选择的Text和Value
- jQuery获取Select option 选择的Text和Value
- jQuery获取Select option 选择的Text和Value
- jquery 获取Select option 选择的Text和Value
- 【转载】jQuery获取Select option 选择的Text和Value
- jQuery获取Select option 选择的Text和Value
- jQuery获取Select option 选择的Text和Value
- 同步图运算框架GraphLite实例之PageRank算法
- 在C#中使用EntityFramework(EF)生成实体进行存储过程的调用
- LEETCODE02
- Google VR 使用详解
- 网络通信socket连接数上限
- jquery获取select中的option的text值
- 设计模式-单例模式
- 第十一单元总结
- GSON解析JSON保存到数据库
- poj 3304 Segments (跟所有线段相交的直线)
- 键盘行单词求解
- 常用的概率分布:二项式分布,贝塔分布,狄里克雷分布
- 数组之找出Array中重复次数最多的数
- Qt5下实现摄像头预览及捕获图像方法实例