0
Hi. Im a beginner with HTML CSS Javascript and i want to build a checkers game. What is the best way?
I was thinking of useing a table as the borad and circle images as the pices. Im not sure if it will work is there a better way to do it. Can someone please judjest something? Thank you!
8 Antworten
+ 1
Thanks a lot. I'll try it.
+ 1
Hey man thanks for the help. Im now looking to insert javascript by using the DOME how can i enter he elements such as a table into a var so i can start working with it?
+ 1
How do you mean? Enter the elements where exactly?
+ 1
Can you link us the code maybe?
You can set up a simple web code here on Sololearn directly, with HTML, CSS and Javascript.
That would make it easiest for us to take a look and help you find the problem.
0
For my chessboard, I pushed a bunch of divs into a div and looked up unicode chars to put in there.
That was an easy-to-handle, lazy solution.
Probably you can find some unicode signs that look like black and white stones.
In my go board, I drew circles on a canvas. That was a bit messier to do.
Feel free to riff on these patters if they work for you.
Excited to see what other people suggest.
(In the chess board I used Brython for the Javascript part, but it doesn't look very different in JS.
I basically appended the field divs, gave them style attributes and an id, stored the reference to each field and finally added a 'click' event listener to them.
If you get into trouble with that, we can sort that part out.)
https://code.sololearn.com/W5v76nCjupV7/?ref=app
https://code.sololearn.com/W1VLQ6PKTm6j/?ref=app
0
I made a checker board using a table and uni code. I want now to start programing the javascript in an external ".js" page while using the DOME.
-The table has an id "board".
And i started off by coding :
var t = document.getElementById("board").innerHTML;
but gives me an error.
How can i code it?
0
This is the code i started