HTML5 Multiple choices


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

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


 

 

 

 



C


Solution:-

The HTML <canvas> element is used to draw graphics on any web page. It is used to draw graphics, on the fly, using JavaScript. The <canvas> element is only a container for graphics. You must use JavaScript to actually draw the graphics. Canvas has several methods for drawing like paths, boxes, circles, text, and adding images.

Examples:
A canvas is a rectangular area on an HTML page. By default, a canvas has no content and no border.

The markup looks like this,

<canvas id="SlightBookCanvas" width="400" height="200"></canvas>

Add JavaScript, Post creating the rectangular canvas area, you must add JavaScript to do the drawing.

Example:

<script>
var c = document.getElementById("SlightBookCanvas");
var ctx = c.getContext("2d");
ctx.moveTo(0, 0);
ctx.lineTo(200, 100);
ctx.stroke();
</script>

 




Next 5 multiple choice(s)

1

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

2

Which input type defines a slider control?

3

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

4

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

5

Which HTML5 element defines navigation links?

Comments