+ 2

Why won't canvas work?

So i just found out about the valentines coding completion and so I started my code and made this empty rectangle but it's giving me an error. Can someone help? https://sololearn.com/compiler-playground/Wvta0PI3yzEa/?ref=app

11th Feb 2025, 10:45 PM
Astro link
Astro link - avatar
2 Réponses
+ 4
onload =()=>{ let canvas = document.getElementById("letter"); let ctx=canvas.getContext("2d") ctx.fillStyle="white"; ctx.fillRect(50,100,200,200); }
12th Feb 2025, 12:21 AM
Bob_Li
Bob_Li - avatar
+ 2
I solved it already but thanks
12th Feb 2025, 12:23 AM
Astro link
Astro link - avatar