HTML5 Multiple choices


Total available count: 25
Subject - Web Development
Subsubject - HTML5

The <canvas> element in HTML5 is used to:


 

 

 

 



D


Solution:-

HTML5 - Canvas:-
HTML5 element <canvas> gives you an easy, simple, and powerful method to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions, or do simple animations as well as very complex animations.

Below is a simple <canvas> element that has only two specific attributes width and height plus all the core HTML5 attributes like id, name, and class, etc.

<canvas id = "mySlightBook" class="SlightBook" width = "250" height = "250"></canvas>

You can easily find that <canvas> element in the DOM using getElementById() method as follows −

var canvas = document.getElementById("mySlightBook");

Let us see an easy and simple example of using <canvas> element in an HTML5 document.

<!DOCTYPE HTML>
<html>
 <head>
  <style>
    #mySlightBook{border:1px solid yellow;}
  </style>
 </head>
 <body>
   <canvas id = "mySlightBook" width = "250" height = "250"></canvas>
 </body>
</html>

 




Next 5 multiple choice(s)

1

Graphics defined by SVG is in which format?

2

In HTML5, you can embed SVG elements directly into an HTML page.

3

In HTML5, contextmenu and spellcheck are:

4

The new HTML5 global attribute, "contenteditable" is used to:

5

In HTML5, which method is used to get the current location of a user?

Comments