HTML <canvas> Tag

The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript).The <canvas> tag is only a container for graphics, you must use a script to actually draw the graphics.


<!DOCTYPE html>

<canvas id="myCanvas">Your browser does not support the HTML5 canvas tag.</canvas>


var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0, 0, 90, 90);


© copyright 2017-2022 Completedone pvt ltd.