GK Question

technology medium mcq

Which HTML5 element is used for drawing graphics via JavaScript?

  1. <svg>
  2. <canvas>
  3. <figure>
  4. <draw>

Answer: <canvas>

<canvas> provides a bitmap area for rendering graphics via JavaScript (lines, shapes, images, animations). <svg> is for vector graphics defined in XML. Both enable interactive visuals, but canvas is pixel-based and better for games/real-time rendering. Important for web development fundamentals.

Topic Web Technologies
Exam Relevance SSC JE, Banking IT, Railway