国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
jQuery-對(duì)Select的操作集合

1. $("#select_id").change(function(){//code...});   //為Select添加事件,當(dāng)選擇其中一項(xiàng)時(shí)觸發(fā)
2. var checkText=$("#select_id").find("option:selected").text();  //獲取Select選擇的Text
3. var checkValue=$("#select_id").val();  //獲取Select選擇的Value
4. var checkIndex=$("#select_id ").get(0).selectedIndex;  //獲取Select選擇的索引值
5. var maxIndex=$("#select_id option:last").attr("index");  //獲取Select最大的索引值 

6. $("#select_id ").get(0).selectedIndex=1;  //設(shè)置Select索引值為1的項(xiàng)選中
7. $("#select_id ").val(4);   //設(shè)置Select的Value值為4的項(xiàng)選中
8. $("#select_id option[text='jQuery']").attr("selected", true);   //設(shè)置Select的Text值為jQuery的項(xiàng)選中

9. $("#select_id").append("<option value='Value'>Text</option>");  //為Select追加一個(gè)Option(下拉項(xiàng))
10. $("#select_id").prepend("<option value='0'>請(qǐng)選擇</option>");  //為Select插入一個(gè)Option(第一個(gè)位置)
11. $("#select_id option:last").remove();  //刪除Select中索引值最大Option(最后一個(gè))
12. $("#select_id option[index='0']").remove();  //刪除Select中索引值為0的Option(第一個(gè))
13. $("#select_id option[value='3']").remove();  //刪除Select中Value='3'的Option
14. $("#select_id option[text='4']").remove();  //刪除Select中Text='4'的Option

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
jQuery對(duì)象[0]倒底是什么? - skykang - 博客園
淺談jquery關(guān)于select框的取值和賦值
jquery獲得option的值和對(duì)option進(jìn)行操作
jQuery-對(duì)Select的操作集合[終結(jié)篇] - 博客文庫(kù) - 博客園
Jquery和javascript常用技巧
jquery chosen插件使用及select常用方法
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服