Attaching event handler to DOM elements

前端 未结 6 726
[愿得一人]
[愿得一人] 2021-01-28 12:30

I am working on a tic tac toe game, which is almost complete. The only thing I am left wondering about is if it is possible to add an event handler for onclick fro

6条回答
  •  灰色年华
    2021-01-28 12:56

    If you use jQuery something like this should work:

    $(document).ready(function() {
      $('#board div').click(playerMove);
    });
    

提交回复
热议问题