oakmac / chessboardjs

JavaScript chessboard
https://chessboardjs.com
MIT License
2k stars 406 forks source link

find what is on a particular square #212

Closed moblizeit closed 3 years ago

moblizeit commented 3 years ago

i am using onSquareClick event which give me a square that was clicked. i am interested to know if that square is empty or have a black or white piece.

i could not find any method to do that, please advise

oakmac commented 3 years ago

Use the position method to get the location of all the pieces on the board.