Home > DeveloperSection > Interviews > What the use of Canvas Element in HTML5

Posted on    October-20-2012 8:09 AM

 HTML5 HTML5 
Ratings:
 1 Answer(s)
  3189  View(s)
Rate this:

AVADHESH PATEL

Total Post:257

Points:1285
Posted on    October-20-2012 12:00 AM

The canvas element is used to draw graphics images on a web page by using javascript like below
<canvas id="pcdsCanvas" width="500" height="400"></canvas> <script type="text/javascript">
var pcdsCanvas=document.getElementById("pcdsCanvas");
var pcdsText=pcdsCanvas.getContext("2d");
pcdsText.fillStyle="#82345c";
pcdsText.fillRect(0,0,150,75);
</script>

Don't want to miss updates? Please click the below button!

Follow MindStick