function pole(rows, cols, el) {
el = document.getElementById(el)
for (; rows--;) {
var div = document.createElement("div");
for (var j=0; j<cols; j++) {
var d = div.cloneNode();
d.classList.add("block");
div.appendChild(d);
};
el.appendChild(div)
};
};
pole(3, 3, "game")
|