Black King

chessboard.js

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

Download v0.3.0

As easy as two lines.

HTML

<div id="board1" style="width: 400px"></div>

JavaScript

var board1 = new ChessBoard('board1', 'start');

Customize with a powerful API.

HTML

<div id="board2" style="width: 400px"></div>
<input type="button" id="startBtn" value="Start" />
<input type="button" id="clearBtn" value="Clear" />

JavaScript

var board2 = new ChessBoard('board2', {
  draggable: true,
  dropOffBoard: 'trash',
  sparePieces: true
});
$('#startBtn').on('click', board2.start);
$('#clearBtn').on('click', board2.clear);

chessboard.js is released under the MIT License

the code can be found on GitHub