jq:对下拉框select的操作的总结
来源:互联网 发布:手机淘宝如何退保证金 编辑:程序博客网 时间:2024/06/05 02:50
用以下代码进行举例吧:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>下拉列表</title> <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script></head><body>下拉列表<select id="select1"> <option value>请选择</option> <option value="1">选项1</option> <option value="2">选项2</option> <option value="3">选项3</option> <option value="4">选择4</option> <option value="5">选择5</option></select></body><script type="text/javascript"></script></html>
1、获取下拉列表的value
$("#select1 option:selected").val();
或者
$("#select1").val();
2、获取下拉列表的文字
$("#select1 option:selected").html();
或者
$("#select1").html();
阅读全文
1 0
- jq:对下拉框select的操作的总结
- jq操作select下拉框
- js对select下拉框的操作
- 对下拉框Select的操作
- jQuery对下拉框Select操作总结
- jQuery对下拉框Select操作总结
- jQuery对下拉框Select操作总结
- jQuery对下拉框Select操作总结
- jQuery对下拉框Select操作总结
- Jquery对select 下拉列表的操作
- javascript对下拉列表框(select)的操作
- javascript对下拉列表框(select)的操作
- javascript对下拉列表框(select)的操作
- javascript对下拉列表框(select)的操作
- jquery对html中的下拉框select的操作
- javascript对下拉列表框(select)的操作
- js对下拉框(select)的动态操作
- javascript对下拉列表框(select)的操作
- python学习笔记之009.py
- Promise胡思乱想(一)
- 跨计算机、跨平台、跨语言对象表示格式JSON必火
- jquery php json cookie ajax 解决跨域的问题
- python学习笔记之010.py
- jq:对下拉框select的操作的总结
- Linux常用命令-Shell技巧及其他
- IO流(一)概述
- python学习笔记之011.py
- mysql 如何用一个表的字段填充另一个表
- Java虚拟机发展史
- java书籍
- C++ STL中的map和vector
- poj 3628 Bookshelf 2(01背包)