jquery 操作select控件 遍历option
来源:互联网 发布:不易乎世,不成乎名 编辑:程序博客网 时间:2024/06/05 23:14
1 判断checkbox 是否被选中
var isSmToggle = $("#isSmToggle").attr("checked");
2 获取下拉列表的选中的值,其中taskListSrc是checklist的id
var select = $("#taskListSrc option:selected").val(); //获取selected的值
3 将下拉列表选中的项置为不可编辑
$('#taskListSrc option:selected').attr("disabled", true);
4 向下拉列表中添加一项,select是要添加的项
$('#taskListTarget').append('<option>' + select + '</option>');
5 清空下拉列表
$('#taskListTarget').empty();
6 设置指定内容项为选中
$("#select_id option[text='content']").attr("selected", true);
7 设置Select索引值为1的项选中
$("#select_id ").get(0).selectedIndex=1; //设置Select索引值为1的项选中
8 遍历option
existOptText = $("selectId option").each(function() { var op = $(this).text(); ... // do with op });
- jquery 操作select控件 遍历option
- jQuery对select操作小结(遍历option,操作option)
- 浅析jQuery对select操作小结(遍历option,操作option)
- 浅析jQuery对select操作小结(遍历option,操作option)
- jquery select option 操作
- jquery select option 操作
- jquery操作select option
- jquery操作select option
- jquery select option操作
- JQuery操作select中的option
- jquery 遍历select所有的option
- jquery 遍历select option 结果集
- jquery 遍历select option 结果集
- jquery动态获取select控件的option
- jquery操作select控件
- JS操作select控件的option
- 小心使用jquery操作select option表单
- JQuery 对 Select option 的操作
- MonthCalendarCtrl
- 【ASM系列1】visitor模式
- java二分查找
- PagerCtrl
- POJ 2492 A Bug's Life and POJ 1703 Find them, Catch them
- jquery 操作select控件 遍历option
- ProcessBarCtrl
- android目录结构分析
- Struts-2.3.X开发配置
- RichEdit
- 开始→运行→命令集锦
- ScrollBar
- 298. Nature is the true law. 天行有常,不为尧存,不为舜亡
- StaticCtrl