<

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.

Example



<!DOCTYPE html>
<html>
<body>

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

<script>

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

</script>
</body>
</html>

















© copyright 2017-2022 Completedone pvt ltd.