Interview Question

What is canvas in HTML5?

Canvas is a JavaScript-powered pixel drawing surface.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

`<canvas>` is a drawing area controlled mainly with JavaScript. • It draws pixels, shapes, charts, games, or animations. • The drawing is not made from normal child HTML elements. • Canvas is useful when many pixels change quickly.

💡 Simple Example

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

⚡ Quick Revision

Canvas is a JavaScript-powered pixel drawing surface.