网站首页 > 知识剖析 正文
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实现前后端完美交互
- 最近发表
-
- HTTP/3 黑科技:三次握手如何进阶 QUIC?30 年通信细节揭秘
- Markdown 语法速查手册与教程(markdown语法是什么意思)
- 二 计算机网络 前端学习 物理层 链路层 网络层 传输层 应用层 HTTP
- 计算机网络之HTTP协议(http网络协议原理)
- 零基础学习网站必知—http协议等资料大全
- Python文件操作:读写txt/csv/json的终极方案
- Tomcat处理HTTP请求流程解析(tomcat如何解析http参数)
- 一日一技:如何正确渲染大模型返回的Markdown?
- 从零开始,30天学会在Shopify上开店之店铺设置–Day5
- 壹起航:网站优化之网站代码优化(网站代码优化工具)
- 标签列表
-
- 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)