js 动态更新option
var sel = document.getElementById("MsgTmpId"); $("#TmpId").find("option").remove(); $.each(data.Data, function (index, item) { var opt = document.createElement("option"); opt.innerHTML = item.TemplateName; opt.value = item.Id; opt.setAttribute("varsList", item.VariableList); opt.setAttribute("templateContent", item.TemplateContent); sel.appendChild(opt); });
小人才疏学浅,看官不喜勿喷,谢谢