HTML5 Canvas

  • Allows to render 2D shapes or graphics on web page with help of JavaScript.
  • Allows creating animation.

<canvas id="myCanvas" width="200" height="200"></canvas>
<script>
    var c=document.getElementById("myCanvas");
    var ctx=c.getContext("2d");
    ctx.fillStyle="#00FF00";
    ctx.fillRect(0,0,250,250);
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *