ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
> 父类目 **select1** > 子类别 **select2** ***** ``` <div class="control-group"> <label class="control-label" >进件行业类目</label> <div class="controls"> <select class="selectl select1" lay-verify="required" > <option value="">请选择类目</option> <volist name="mccjc" id="vo"> <option value="{$vo.id}">{$vo.name}</option> </volist> </select> </div> </div> <div class="control-group"> <label class="control-label" >进件行业类别</label> <div class="controls"> <select class="selectl show-tick form-control select2" name="mcc_jc_id"> <option value="">请先进件行业类目</option> </select> </div> </div> ``` ***** ``` <script type="text/javascript"> //进件分类 $(function(){ $('.select1').click(function(){ $(this).change(function(){ var pid = $(".select1 option:selected").val(); $.post('{:U("addmcc")}',{pid:pid},function (data) { console.log(data) var html="<option style='color: #ccc;'>请选择</option>"; $(".select2").empty(); $.each(data,function(k,v){ if(v.name !== undefined){ html += "<option value="+v.id+">"+v.name+"</option>"; } }); $(".select2").append(html); }); }); } ); }); </script> ```