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

Which built-in HTML5 object is used to draw on the canvas?

2

In HTML5, which attribute is used to specify that an input field must be filled out?

3

Which input type defines a slider control?

4

Which input type defines a week and year control (no time zone)?

5

Which HTML5 element is used to display a scalar measurement within a known range?

Comments