HTML <canvas> Tag
Example Draw a red square, on the fly, and show it inside the <canvas> element: <canvas id=”myCanvas”></canvas> <script> var canvas = document.getElementById(“myCanvas”); var ctx = canvas.getContext(“2d”); ctx.fillStyle = “#FF0000”; ctx.fillRect(0, 0, 80, 80); </script> Try it Yourself » Definition and Usage The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript). The <canvas> tag is only a container […]
