I am programming a javascript based tic tac toe game.
I want to make it so that after the user completes a game, none of the open spaces are clickable again, therefore making it so that they cannot continue to add x’s to the board.
Currently I begin the program using JQuery to make spots of the grid like so:
$('#upleft').click(function()
the rest occurs correctly, but this is what makes it clickable to my understanding.
Each space while having the unique id specified above also has a class of tictactoe, and so I thought to turn off the “clickability” by doing this:
$(document).off("click", ".tictactoe");
However it does not seem to be working. Any suggestions? I’m open to other functions and such. Thank you!
You should call the
offmethod on the element.