canvas provides a 2D drawing API through JavaScript. Get the context with getContext('2d'). Draw with fillRect(), arc(), and drawImage(). Use requestAnimationFrame for smooth 60fps animation loops.
HTML5 Canvas
<canvas id="myCanvas" width="400" height="200"></canvas>
<script>
const canvas = document.getElementById("myCanvas");
const ctx = canvas.getContext("2d");
ctx.fillStyle = "blue";
ctx.fillRect(10, 10, 100, 80);
ctx.beginPath();
ctx.arc(200, 100, 50, 0, Math.PI * 2);
ctx.fillStyle = "red";
ctx.fill();
</script>