Skip to content

Latest commit

 

History

History
40 lines (16 loc) · 692 Bytes

Canvas.md

File metadata and controls

40 lines (16 loc) · 692 Bytes

Canvas

s

The tag allows you to create dynamic graphics and animations using JavaScript. You can use the Canvas API to draw shapes, lines, and text, as well as create animations and interactive applications.

<script> const canvas = document.getElementById("myCanvas"); const ctx = canvas.getContext("2d"); // Draw a rectangle ctx.fillStyle = "red"; ctx.fillRect(10, 10, 50, 50); // Draw a circle ctx.beginPath(); ctx.arc(75, 75, 30, 0, 2 * Math.PI); ctx.fillStyle = "blue"; ctx.fill(); </script>