tic tac toe implementation in javascript with jquery