I don't know why I am getting this error. I think I have closed every bracket.
I tried making the id letters instead of numbers.
function check(x,y) {
coor = "'" + x + y + "'";
if (document.getElementById(coor).classList.contains("bomb")) {
document.getElementById('WoL').innerHTML = "You lose.";
}
}
HTML:
<div class = "grid-square" onclick = "check(1,8)" id = "18">?</div>
I expect the output to make the paragraph with id "WoL" say "You lose." if you click on the div and it is a bomb.