summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2022-12-23 21:39:21 +0100
committerErich Eckner <git@eckner.net>2022-12-23 21:39:21 +0100
commite01d03ff45650c636460f10154c0d9a6ac61a629 (patch)
treedf8e84c0aaee489ea23f02d13a2a88d3d0b29233
parent356c1957aa44cf3a2166105bbd669dcfc9fcde47 (diff)
downloadwordle-frontend-e01d03ff45650c636460f10154c0d9a6ac61a629.tar.xz
only add rows to table, not additional tbodys
-rw-r--r--index.html9
1 files changed, 4 insertions, 5 deletions
diff --git a/index.html b/index.html
index 0023cbc..ba29209 100644
--- a/index.html
+++ b/index.html
@@ -2,11 +2,10 @@
<html>
<body>
<h1>wordle</h1>
-<table id="the_table">
-</table>
+<table id="the_table"><tbody></tbody></table>
<p id="debug"></p>
<script>
- let table = document.getElementById("the_table");
+ let table = document.getElementById("the_table").getElementsByTagName("tbody")[0];
let row_count = 0;
let cursor_column = 1;
let puzzle = '';
@@ -40,9 +39,9 @@
}
addNewRow = function() {
row_count++;
- the_table.innerHTML += "<tr id=\"row_" + row_count + "\" style=\"height:2em\"></td>";
+ table.innerHTML += "<tr id=\"row_" + row_count + "\" style=\"height:2em\"></tr>";
for (let i = 1; i <= 5; i++) {
- the_table
+ table
.querySelector("#row_" + row_count)
.innerHTML += "<td id=\"column_" + i + "\" style=\"" + cell_style + "\"></td>";
}