diff options
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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>"; } |