1

I want to create a simple Tic-Tac-Toe game with Python. It will be just a 3x3 table.

The question is how to capture a click when user clicks on a specific cell? Do I need to use JavaScript / jQuery for this ar can it be done with Python?

Thanks in advance!

2
  • 1
    You should use JS to capture the click then JS should send a post request to Django with the position of the click. Commented Dec 6, 2018 at 13:13
  • 1. Write some HTML to define your 9 fields and give each field an ID. 2. when one of those IDs is clicked send an xhr/ajax request (you need javascript for this) 3. validate the input (filed which was clicked) with python and send a response to the frontend (html,js) Commented Dec 6, 2018 at 14:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.