From e62cd8158a323424530defd1c7b409c08c34282f Mon Sep 17 00:00:00 2001 From: Playmaker1210 Date: Mon, 30 May 2022 16:53:05 +0200 Subject: [PATCH] update --- javascript/matrixok/script.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/javascript/matrixok/script.js b/javascript/matrixok/script.js index b6d3860..9b3a8aa 100644 --- a/javascript/matrixok/script.js +++ b/javascript/matrixok/script.js @@ -144,16 +144,17 @@ function matrixKiiras(){ matrix1_container.appendChild(sor); } -} - -/* -1x2 - 6,6 - -2x3 - 6,6,6 - 6,6,6 - - -*/ \ No newline at end of file + for (let i = 0; i < matrix2.length; i++) { + let sor = document.createElement("div"); + sor.setAttribute("class", "sor"); + for (let j = 0; j < matrix2[i].length; j++) { + let elem = document.createElement("div"); + elem.setAttribute("class", "elem"); + let text = document.createTextNode(matrix2[i][j]); + elem.appendChild(text); + sor.appendChild(elem); + } + matrix2_container.appendChild(sor); + } +} \ No newline at end of file