I need to convert the table grid i created into an multidimensional array according to the content inside the table. Array would be in format like:
var arra
Run a for loop through the rows and the fields:
var array = [];
var table = document.querySelector("table tbody");
var rows = table.children;
for (var i = 0; i < rows.length; i++) {
var fields = rows[i].children;
var rowArray = [];
for (var j = 0; j < fields.length; j++) {
rowArray.push(fields[j].innerHTML);
}
array.push(rowArray);
}
console.log(array);
JSfiddle.