我正在尝试为正在制作的乒乓球游戏绘制黑色画布,但无法在屏幕上绘制
我已经检查过控制台,没有错误
// select the canvas that we have made in our html file
const cvs = document.getElementById("pong");
const ctx = cvs.getContext("2d");
// draw our rectangle function
function drawRect(x, y, w, h, color) {
ctx.fillStyle = color;
ctx.fillRect(x, y, w, h);
}
drawRect(0, 0, cvs.wdith, cvs.height, "BLACK");
<canvas id="pong" width="600" height="400"></canvas>