+ 4
Just make sure to put all your code inside the function, which is called AFTER the whole page has loaded.
window.onload=function() {
const canv=document.getElementById("ohgod");
const ctx=canv.getContext("2d");
ctx.beginPath();
ctx.rect(15,30,60,60);
ctx.closePath();
}