1.

What is the purpose of the canvas element?(a) Creates drawing surface(b) Exposes powerful drawing API to client-side JavaScript(c) Creates drawing surface & Exposes powerful drawing API to client-side JavaScript(d) Creates a rectangular boxThis question was addressed to me in unit test.My enquiry is from Graphics topic in chapter Graphics and Rendering of JavaScript

Answer»

The correct choice is (c) Creates DRAWING surface & Exposes powerful drawing API to client-side JavaScript

Explanation: The HTML canvas element is used to draw graphics, on the fly, via JavaScript. The canvas element is only a CONTAINER for graphics. The canvas element has no APPEARANCE of its own but creates a drawing surface WITHIN the DOCUMENT and exposes a powerful drawing API to client-side JavaScript.



Discussion

No Comment Found

Related InterviewSolutions