Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which HTML5 element is used for drawing graphics on the fly ?

  • A.<svg>
  • B.<canvas>
  • C.<graphic>
  • D.<draw>

Answer: B

The element is <canvas>.

The HTML5 canvas element provides a bitmap drawing surface. JavaScript draws on it on the fly through its 2D or WebGL context, with lines, shapes, images and text drawn pixel by pixel. That makes it suited to games, charts and animation.

The svg element also produces graphics, but it describes them declaratively as vector shapes kept in the page's DOM, rather than drawing them by script on a pixel surface. There are no standard HTML elements called graphic or draw.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.