健身房里的欲乱h文_筱惠欲乱美女全文免费_欧美无遮挡一区二区三区_国产极品粉嫩福利在线观看

將想法與焦點(diǎn)和您一起共享

網(wǎng)站開發(fā)中jQuery操作select 的option發(fā)布者:本站     時間:2020-05-16 08:05:12

jQuery操作select 的option

$(function(){
           $("#addip").click(function(){
                                      var $beginip1=$("#s_ip_1").val();
                                      var $beginip2=$("#s_ip_2").val();
                                      var $beginip3=$("#s_ip_3").val();
                                      var $beginip4=$("#s_ip_4").val();
                                      var $endip1=$("#e_ip_1").val();
                                      var $endip2=$("#e_ip_2").val();
                                      var $endip3=$("#e_ip_3").val();
                                      var $endip4=$("#e_ip_4").val();
                                      var $beginip=$beginip1+"."+$beginip2+"."+$beginip3+"."+$beginip4;
                                      var $endip=$endip1+"."+$endip2+"."+$endip3+"."+$endip4;
                                      //檢查IP段
                                      if($beginip1>$endip1){
                                          alert("起始IP不能大于結(jié)束IP地址");
                                      }
                                      //驗(yàn)證數(shù)據(jù)庫是否存在
                                     
                                      //添加到select的選項(xiàng)
                                      if($("#ip_type:checked").val()=="1"){
                                          //IP段
                                          $("#limit_ip_list").append("<option value='"+$beginip+"~"+$endip+"'>"+$beginip+"~"+$endip+"</option>");
                                      }else{
                                          $("#limit_ip_list").append("<option value='"+$beginip+"'>"+$beginip+"</option>");
                                      }
                                      });
});
 

 

<table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td colspan="2"><input type="radio" name="ip_type" id="ip_type" value="1" checked="checked"/>
            IP段
            <input type="radio" name="ip_type" id="ip_type" value="0" />
            IP值</td>
          <td>被限制的IP列表</td>
          <td></td>
        </tr>
        <tr>
          <td><input name="s_ip_1" id="s_ip_1" type="text" size="4" value="192">
            .
            <input name="s_ip_2" id="s_ip_2"  type="text" size="4" value="168"/>
            .
            <input name="s_ip_3" id="s_ip_3"  type="text" size="4" value="0"/>
            .
            <input name="s_ip_4" id="s_ip_4"  type="text" size="4" value="0"/></td>
          <td rowspan="3"><input type="button" name="addip" id="addip" value="=>" /></td>
          <td rowspan="3"><select style="width:230px" size="5" multiple="multiple" id="limit_ip_list" name="limit_ip_list">
              <option value="192.168.1.0~192.168.1.255">192.168.1.0~192.168.1.255</option>
              <option value="192.168.0.100">192.168.0.100</option>
            </select></td>
          <td rowspan="3"> 可雙擊刪除<br />
            <input type="button" name="delip" id="delip" value="刪除選擇" /></td>
        </tr>
        <tr>
          <td align="center" bgcolor="#FFFFFF">~</td>
          <td></td>
        </tr>
        <tr>
          <td bgcolor="#FFFFFF"><input name="e_ip_1" id="e_ip_1"  type="text" size="4" value="192">
            .
            <input name="e_ip_2" id="e_ip_2" type="text" size="4" value="168"/>
            .
            <input name="e_ip_3" id="e_ip_3" type="text" size="4" value="0"/>
            .
            <input name="e_ip_4" id="e_ip_4" type="text" size="4" value="0"/></td>
          <td></td>
        </tr>
      </table>



選擇我們,優(yōu)質(zhì)服務(wù),不容錯過
1. 優(yōu)秀的網(wǎng)絡(luò)資源,強(qiáng)大的網(wǎng)站優(yōu)化技術(shù),穩(wěn)定的網(wǎng)站和速度保證
2. 15年上海網(wǎng)站建設(shè)經(jīng)驗(yàn),優(yōu)秀的技術(shù)和設(shè)計(jì)水平,更放心
3. 全程省心服務(wù),不必?fù)?dān)心自己不懂網(wǎng)絡(luò),更省心。
------------------------------------------------------------
24小時聯(lián)系電話:021-58370032