var newdiv=document.createElement("div");
newdiv.className="switch-animate switch-on"
newdiv.id="switch_div"
document.getElementById("dhcpd_div").appendChild(newdiv);
var rinput = document.createElement("input");
rinput.setAttribute("type","checkbox");
rinput.setAttribute("name","dhcpd_name");
rinput.setAttribute("id",\'dhcpd\');
document.getElementById(\'switch_div\').appendChild(rinput);
rinput.setAttribute("checked",\'checked\');
var spanON = document.createElement("span");
spanON.className = "switch-left switch-success";
spanON.innerHTML = "ON";
document.getElementById("switch_div").appendChild(spanON);
var label_var = document.createElement("label");
label_var.innerHTML = " ";
document.getElementById("switch_div").appendChild(label_var);
var spanOFF = document.createElement("span");
spanOFF.className = "switch-right switch-warning";
spanOFF.innerHTML = "OFF";
document.getElementById("switch_div").appendChild(spanOFF);
相关文章: