我有这个 :
var el1 = document.getElementById("el1");
var el2 = document.getElementById("el2");
var el3 = document.getElementById("el3");
el1.style.width = "100px";
el2.style.width = "100px";
el3.style.width = "100px";
有什么方法可以使这段代码更短,更易于维护?
如果我需要:
el1.style.width = "100px";
el2.style.width = "145px";
el3.style.width = "120px";
谢谢