From 120bdb430ca41356edb5df27e1d4f4dd7cebf03c Mon Sep 17 00:00:00 2001 From: ElGurkus Date: Mon, 2 Nov 2020 10:29:04 +0100 Subject: [PATCH 1/2] changed code -> added debug for wich field was clicked --- code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code.js b/code.js index 2232eb5..173e345 100644 --- a/code.js +++ b/code.js @@ -1,3 +1,3 @@ function selectField(field){ - + console.log(field.id); } \ No newline at end of file From 1885fcc51794ace5f814d860025940abe83e82d7 Mon Sep 17 00:00:00 2001 From: ElGurkus Date: Mon, 2 Nov 2020 11:10:54 +0100 Subject: [PATCH 2/2] changed code -> sets .selected for all fields to 0 changed index -> script now gets loaded at the end of the body --- code.js | 6 ++++++ index.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code.js b/code.js index 173e345..3bc07e7 100644 --- a/code.js +++ b/code.js @@ -1,3 +1,9 @@ +let fieldId = 0; +for(let i = 0; i < 64; i++){ + fieldId = i.toString(); + document.getElementById("field"+fieldId).selected = 0; +} function selectField(field){ console.log(field.id); + field.style.backgroundColor = "rgb(227,8,8, 0.3)"; } \ No newline at end of file diff --git a/index.html b/index.html index 1a15961..f8d2d63 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,6 @@ Title -