HTML5 Tag: CANVAS

Defination

The <canvas> tag is used to draw graphics, on the fly by javascript.

Example
<canvas id="canvasTag"></canvas>

<script>
var canvas, ctx;
canvas = document.getElementById("canvasTag");
ctx = canvas.getContext("2d");
ctx.fillStyle = "#000000";
ctx.fillRect(0, 0, 100, 100);
</script>
Live Preview

Copyright @ 2024 DevelopNew. All Rights Reserved