There is a two-dimensional array, or rather a function that creates it:
function createMatrix(width, height) { var matrix = []; var coll = []; for (var i = 0; i < width; i++) { matrix[i] = coll; for (var j = 0; j < height; j++) { var div = document.createElement('div'); div.className = 'cell'; matrix[i][j] = div; } } return matrix; } And there is div.field , how to display a grid of the width at height consisting of div.field filled with array elements (in this case, the div is you). For example:
var f = createMatrix(20, 20); It is expected to receive a grid with the size of 20 rows, 20 columns with cells filled with divas.
@and nickname, otherwise the alert does not come. - Grundy