网站首页 > 知识剖析 正文
jquery获得下拉框值的代码,使用jquery的朋友可以参考下:
获取Select :
获取select 选中的 text :
$("#ddlRegType").find("option:selected").text();
获取select选中的 value:
$("#ddlRegType ").val();
获取select选中的索引:
$("#ddlRegType ").get(0).selectedIndex;
设置select:
设置select 选中的索引:
$("#ddlRegType ").get(0).selectedIndex=index;//index为索引值
设置select 选中的value:
设置select 选中的text:
设置select option项:
清空 Select:
$("#ddlRegType ").empty();
猜你喜欢
- 2024-11-10 详解jQuery(一) jqueryui
- 2024-11-10 web前端Jquery学习笔记一 jquery 前端
- 2024-11-10 select输入联想内容 selectinsert
- 2024-11-10 jquery为表单控件传值并提交表单 jquery提交表单调用serialize方法
- 2024-11-10 jQuery基本操作 jquery基础
- 2024-11-10 利用jQuery实现简单的数据双向绑定
- 2024-11-10 jQuery基础教程学习笔记(五)事件的绑定和解绑
- 2024-11-10 jQuery中的事件——事件绑定、合成事件
- 2024-11-10 前端开发培训JQuery标准教案 前端开发教学
- 2024-11-10 JS类库Jquery(二):优雅的使用JQuery写Ajax实现前后端完美交互
- 最近发表
- 标签列表
-
- xml (46)
- css animation (57)
- array_slice (60)
- htmlspecialchars (54)
- position: absolute (54)
- datediff函数 (47)
- array_pop (49)
- jsmap (52)
- toggleclass (43)
- console.time (63)
- .sql (41)
- ahref (40)
- js json.parse (59)
- html复选框 (60)
- css 透明 (44)
- css 颜色 (47)
- php replace (41)
- css nth-child (48)
- min-height (40)
- xml schema (44)
- css 最后一个元素 (46)
- location.origin (44)
- table border (49)
- html tr (40)
- video controls (49)