diff --git a/code.js b/code.js index 3bc07e7..0aed2aa 100644 --- a/code.js +++ b/code.js @@ -5,5 +5,11 @@ for(let i = 0; i < 64; i++){ } function selectField(field){ console.log(field.id); - field.style.backgroundColor = "rgb(227,8,8, 0.3)"; + if(field.selected === 0) { + field.style.backgroundColor = "rgb(227,8,8, 0.3)"; + field.selected = 1; + } else if (field.selected === 1){ + field.style.backgroundColor = "rgb(255,255,255, 1)"; + field.selected = 0; + } } \ No newline at end of file