Platform Support
| Mozilla | Chrome | Safari | Opera | IE | Netscape | 3.7+ | no | 4.0.5+ | 7.0+ | no | no |
|---|
Constructors
| Constructor | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLCanvasElement Constructor() : HTMLCanvasElement
Creates an instance of the HTMLCanvasElement.
|
Show Details | 3.7+ | no | 4.0.5+ | 7.0+ | no | no | ||
HTMLCanvasElement() : HTMLCanvasElementCreates an instance of the HTMLCanvasElement. Returns
|
|||||||||
Properties
| Property | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape |
|---|---|---|---|---|---|---|---|
|
width
: Number
Defines the width of the canvas.
|
Show Details | 3.7+ | no | 4.0.5+ | 7.0+ | no | no |
|
|||||||
|
height
: Number
Defines the height of the canvas.
|
Show Details | 3.7+ | no | 4.0.5+ | 7.0+ | no | no |
|
|||||||
Inherited Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
getElementsByClassName(String classNames) : NodeList
Returns a NodeList containing all the
Element nodes with the specified classNames. |
Show Details | 1.9+ | 5.0+ | 3.1+ | 9.51+ | no | no | |||||
|
Parameters
Returns
|
||||||||||||
Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
toDataURL(Array type) : String
Returns the URL for the image in the canvas.
|
Show Details | 3.7+ | no | 4.0.5+ | 7.0+ | no | no | |||||
|
Parameters
Returns
|
||||||||||||
|
getContext(String contextId) : Object
Returns an object that exposes an API for drawing on the canvas.
|
Show Details | 3.7+ | no | 4.0.5+ | 7.0+ | no | no | |||||
|
Parameters
Returns
|
||||||||||||
References
Availability
JavaScript 1.2|WhatWG