I'm trying to play a game of old. So far I have been able to make the markings alternating with each shift and the function to delete the markings.
ps: I'm using black and red instead of ball and "x".
My problem is that the markup changes even after you've marked it if you click on it again. I want that once clicked the elements keep their markings (bgcolor)
.
For this I tried to solve by putting the first if checking if the background has no initial color white, if it does not have false return and stop the function.
if(!casa.style.backgroundColor == "#FFF") return false;
Being that does not work.