0
JavaScript
I am trying to code a red circle I keep getting a syntax error “null is not an object” Here is my JavaScript code: var canvas = document.getElementById("canvas"); var context = canvas.getContext("2d"); var x = 300; var y = 350; context.arc(x, y, 50, 0, 2 * Math.Pi); context.fillStyle="red"; context.fill(); Here is my html code: <canvas id = “canvas” height = “400” width = “600”> </canvas>
3 Respuestas
+ 4
Use “Math.PI”
instead of “Math.Pi”
+ 1
I tried that but it still didn’t work but thank you for your help
+ 1
I solved it finally