我想弄清楚如何用纯JavaScript附加它?我已尝试使用DOM等效,但也许我无法正确编写它。这将是一个国际象棋棋盘格。
divString = "<div class=\"Square " + rankName + " " + fileName + " " + lightString + "\"/>";
$("#Board").append(divString); // <= How can I append this to the canvas with pure JavaScript?
<canvas id="board" width="480" height="480" style="border: solid 1px Black;"></canvas>