changed code -> sets .selected for all fields to 0

changed index -> script now gets loaded at the end of the body
master
ElGurkus 4 years ago
parent 120bdb430c
commit 1885fcc517

@ -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)";
}

@ -4,7 +4,6 @@
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="style.css">
<script src="code.js"></script>
</head>
<body>
<ul>
@ -95,5 +94,6 @@
<td id="field63" class="game fields" onclick="selectField(this)"></td>
</tr>
</table>
<script src="code.js"></script>
</body>
</html>
Loading…
Cancel
Save