You are on page 1of 2

chessboardjs.com » Homepage https://chessboardjs.com/index.

html

chessboard.js
The easiest way to embed a chess board on your site.

Download v1.0.0

Getting Started Examples Documentation Download

As easy as two lines.


7
HTML
6
<div id="board1" style="width: 400px"><∕div>

5
JAVASCRIPT

4
var board1 = Chessboard('board1', 'start')

a b c d e f g h

Customize with a powerful API.


8
HTML

7
<div id="board2" style="width: 400px"><∕div>
<button id="startBtn">Start Position<∕button>
<button id="clearBtn">Clear Board<∕button> 6

5
JAVASCRIPT

var board2 = Chessboard('board2', { 4


draggable: true,
dropOffBoard: 'trash',
3
sparePieces: true
})
2
$('#startBtn').on('click', board2.start)
a b c d e f g h
1

1 of 2 24/11/2021, 22:14
chessboardjs.com » Homepage https://chessboardjs.com/index.html

$('#clearBtn').on('click', board2.clear)

Start Position Clear Board

chessboard.js is released under the MIT License by Chris Oakman


the code can be found on GitHub

2 of 2 24/11/2021, 22:14

You might also like