亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery實(shí)現(xiàn)聯(lián)動(dòng)下拉列表查詢(xún)框

 更新時(shí)間:2017年01月04日 15:23:44   作者:小伍  
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)聯(lián)動(dòng)下拉列表查詢(xún)框,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

在查詢(xún)與列表顯示的時(shí)候經(jīng)常用到聯(lián)動(dòng)列表顯示,比如一級(jí)選項(xiàng)是國(guó)家,二級(jí)選項(xiàng)是省,三級(jí)是市,這樣的聯(lián)動(dòng)是聯(lián)系的實(shí)時(shí)導(dǎo)出的,比如你不可能選擇了四川省卻在三級(jí)聯(lián)動(dòng)欄中出現(xiàn)濟(jì)南市,這樣的聯(lián)動(dòng)實(shí)現(xiàn)方法如下:

效果圖示:

實(shí)現(xiàn)源代碼:

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title></title>
 <meta name="keywords" content=" keywords" />
 <meta name="description" content="description" />
</head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<style type="text/css">
 body{font-size:13px}
 .clsInit{width:435px;height::35px;line-height:35px;padding-left:10px}
 .clsTip{padding-top:5px;background-color:#eee;display:none}
 .btn{border:solid 1px #666;padding:2px;width:65px;float:right;margin-top:6px;margin-right:6px;filter:progid:DXImageTransform.Mcrosoft.Gradient(GraientType=0,StartColorStr=#FFFFFF,EndColorStr=#ECE9D8);}
</style>
<body>
<script type="text/javascript">
 $(function(){
  function objInit(obj){
   return $(obj).html('<option>請(qǐng)選擇</option>');
  }
  var arrData={
   廠(chǎng)商1:{品牌一:'型號(hào)1-1-1,型號(hào)1-1-2',
     品牌二:'型號(hào)1-2-1,型號(hào)1-2-2'},
   廠(chǎng)商2:{品牌一:'型號(hào)2-1-1,型號(hào)2-1-2',
     品牌二:'型號(hào)2-2-1,型號(hào)2-2-2'},
   廠(chǎng)商3:{品牌一:'型號(hào)3-1-1,型號(hào)3-1-2',
     品牌二:'型號(hào)3-2-1,型號(hào)3-2-2'}
  };
  $.each(arrData,function(pF){
   $('#selF').append('<option>'+pF+'</option>');
  });
  $('#selF').change(function(){
   objInit('#selT');
   objInit('#selC');
   $.each(arrData,function(pF,pS){
    if($('#selF option:selected').text()==pF){
     $.each(pS,function(pT,pC){
      $('#selT').append('<option>'+pT+'</option>');
     });
     $('#selT').change(function(){
      objInit('#selC');
      $.each(pS,function(pT,pC){
       if($('#selT option:selected').text()==pT){
        $.each(pC.split(","),function(){
         $('#selC').append('<option>'+this+'</option>');
        })
       }
      })
      
     });
    }
   })
  });
 });
</script>

<div class="clsInit">

 廠(chǎng)商:<select id="selF"><option>請(qǐng)選擇</option></select>
 品牌:<select id="selT"><option>請(qǐng)選擇</option></select>
 型號(hào):<select id="selC"><option>請(qǐng)選擇</option></select>
 <input type="button" value="查詢(xún)" id="Button1" class="btn" />
</div>
<div class="clsInit" id="divTip"></div>

</body>
</html>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論