HTMLCanvasElement
The interface for <canvas>. Extends HTMLElement → Element.
Reflected properties
All setters are guarded and throw NoModificationAllowedError on a read-only document.
| Property | Attribute | Type | Notes |
|---|---|---|---|
width |
width |
number | unset → 300. |
height |
height |
number | unset → 150. |
See also
- Element —
getAttribute/setAttribute, content,classList, traversal, insertion - HTMLElement — the global reflected properties every HTML element inherits
- JavaScript DOM API — the interface hierarchy and
instanceof