+ 1
When i tried this code, it didn't work context.rect(50,50,100,50); context.stroke();
2 ответов
+ 1
You may get more help if you post the code or link to the tutorial you're referencing.
0
Your code is incomplete. You need the <canvas> tag
And a script for the code.
HTML
<canvas id="canvas"></canvas>
JS
const canvas = document.getElementById("canvas");
const context = canvas.getContext("2d");
context.rect(50, 50, 100, 50);
context.stroke();