jump

HTML: The Markup Language (an HTML language reference)

canvascanvas for dynamic graphics NEW # T

The canvas element represents a resolution-dependent bitmap canvas, which can be used for dynamically rendering of images such as game graphics, graphs, or other images.

Permitted contents #

transparent (either phrasing content or flow content )

Permitted attributes #

global attributes
Any attributes permitted globally.
height = non-negative integer #
The height of the canvas, in CSS pixels.
width = non-negative integer #
The width of the canvas, in CSS pixels.

Tag omission #

A canvas element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLCanvasElement : HTMLElement {
           attribute unsigned long width;
           attribute unsigned long height;

  DOMString toDataURL(optional DOMString type, any... arguments);
  DOMString toDataURLHD(optional DOMString type, any... arguments);
  void toBlob(FileCallback? _callback, optional DOMString type, any... arguments);
  void toBlobHD(FileCallback? _callback, optional DOMString type, any... arguments);

  object? getContext(DOMString contextId, any... arguments);
};