最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時(shí)間:2016年01月18日 10:59:25   作者:daliu_it  
這篇文章主要為大家介紹了jQuery實(shí)現(xiàn)多級(jí)聯(lián)動(dòng)下拉列表查詢框,感興趣的小伙伴們可以參考一下

本文實(shí)例介紹了jQuery實(shí)現(xiàn)多級(jí)聯(lián)動(dòng)下拉列表查詢框的詳細(xì)代碼,分享給大家供大家參考,具體內(nèi)容如下

 效果圖:

具體代碼:

<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  <title></title>
  <meta name="keywords" content=" keywords" />
  <meta name="description" content="description" />
</head>
<script src="http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.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={
      廠商1:
      {
        品牌一:'型號(hào)1-1-1,型號(hào)1-1-2',
        品牌二:'型號(hào)1-2-1,型號(hào)1-2-2'
      },
      廠商2:
      {
        品牌一:'型號(hào)2-1-1,型號(hào)2-1-2',
        品牌二:'型號(hào)2-2-1,型號(hào)2-2-2'},
      廠商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">

  廠商:<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="查詢" id="Button1" class="btn" />
</div>
<div class="clsInit" id="divTip"></div>

</body>
</html>

希望本文所述對(duì)大家學(xué)習(xí)jquery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

商都县| 闽清县| 连平县| 蒙阴县| 和静县| 军事| 新兴县| 化隆| 忻州市| 通渭县| 漳平市| 缙云县| 东乡县| 左贡县| 个旧市| 光山县| 清苑县| 昂仁县| 磐安县| 乌拉特中旗| 郁南县| 阿巴嘎旗| 大邑县| 长宁区| 望谟县| 沅江市| 建始县| 文昌市| 左云县| 三台县| 通州区| 芜湖市| 德州市| 延吉市| 武胜县| 安多县| 舒兰市| 新密市| 诸暨市| 东海县| 彭泽县|