HTML5 Multiple choices

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

The <canvas> element in HTML5 is used to:







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.

    #mySlightBook{border:1px solid yellow;}
   <canvas id = "mySlightBook" width = "250" height = "250"></canvas>


Next 5 multiple choice(s)


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


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


Which input type defines a slider control?


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


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