乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      jQuery-對Select的操作集合

       handup 2011-01-06

      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'>請選擇</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

        本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多