HTML5 Question:
Download Job Interview Questions and Answers PDF
Can you explain What the use of Canvas Element in HTML5?
Answer:
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(“phpzagCanvas”);
var pcdsText=pcdsCanvas.getContext(“2d”);
pcdsText.fillStyle=“#82345c”;
pcdsText.fillRect(0,0,150,75);
</script>
<canvas id=“pcdsCanvas” width=“500″ height=“400″>
</canvas>
<script type=“text/javascript”>
var pcdsCanvas=document.getElementById(“phpzagCanvas”);
var pcdsText=pcdsCanvas.getContext(“2d”);
pcdsText.fillStyle=“#82345c”;
pcdsText.fillRect(0,0,150,75);
</script>
Download HTML5 Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell me What purpose does HTML5 serve? | Do you know What is the sessionStorage Object in html5? How to create and access? |