X-admin1.1怎样用ajax添加一个下拉菜单

这是部分的相关代码:
   代码使用jquery拼写出来的
var str = "<select class=\"select\" name=\"acid\" size=\"1\" id=\"acid\">\n" + " <option value=\"\">--请选择--</option>"; for(var vo in data){ var s = "<option value="+data[vo].acid+">"+data[vo].acname+"</option>"; str = str+s; } str = str + "</select>"; var str1 = "<div class='layui-unselect layui-form-select'><div class='layui-select-title'><input type=\"text\" placeholder=\"--请选择--\" value=\"\" readonly=\"\" class=\"layui-input layui-unselect\"><i class=\"layui-edge\"></i></div><dl class=\"layui-anim layui-anim-upbit\">"; for(var vo in data){ var s = "<dd lay-value="+data[vo].acid+" class>"+data[vo].acname+"</dd>"; str1 = str1+s; } str1 = str1 + "</dl></div></div>"; str = str + str1; $("#dacid").html(str);
已邀请:

要回复问题请先登录注册