Toggling between x & O --reset problems

Hi, I have a hard time fixing my toggling functionality between"X" and “O”. Once you choose either x or O and start playing the game…you cannot choose again unless the game is over. But, once the game is over I am not able to switch from x to O/ from O to X. Also my reset is acting weird and I could find the bug.

Hi, I sorry that I did not write the comments completely. when click on

element we are assigning “X” or “O” (line # 133-137 inside the loop function) togglePlayer (at the end the page) decides this assigning(line #496). rotate function giving elements rotation 180 degrees.

I have a trouble with reset function and togglePlayer functionality

Plz provide your feedback on this now

Sorry.wrong link…here is the right one…