0
I thought that a canvas was just a container for graphics made using JavaScript. So why is it that were able to draw those filled squares, when the canvas is empty?
I'm sure it sounds stupid but I'm confused. I did the try it your self option, and checked to see if there was any JavaScript written. But they weren't. Please clarify
2 Respostas
+ 1
You may be confusing canvas graphics with SVG. SVG does not use the canvas. A canvas container is required when drawing with JavaScript.
+ 1
Those field squares aren't the graphics it's just the canvas environment where graphics are drawn used javascript
That is why we have
<canvas id="canvas" width="" height="">
But the actual graphics are drawn using javascript