]> git.sesse.net Git - remoteglot/commitdiff
Use innerHTML slightly less (it is costly).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 24 Dec 2022 22:58:24 +0000 (23:58 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 24 Dec 2022 22:58:24 +0000 (23:58 +0100)
www/js/remoteglot.js

index ee7495f1b138329f857fe0db1e9e8d2a58461176..f4581cf72644032c0b4a6515e1320c7926648222 100644 (file)
@@ -897,8 +897,11 @@ let update_refutation_lines = function() {
                        continue;
                }
 
-               let move = "<a class=\"move\" href=\"javascript:show_line(" + display_lines.length + ", " + 0 + ");\">" + line['move'] + "</a>";
-               move_td.innerHTML = move;
+               let move_link = document.createElement("a");
+               move_link.classList.add("move");
+               move_link.setAttribute("href", "javascript:show_line(" + display_lines.length + ", 0)");
+               move_link.textContent = line['move'];
+               move_td.appendChild(move_link);
 
                let score_td = document.createElement("td");
                tr.appendChild(score_td);