canvas property

Reference to the canvas object that the associated WebGLRenderingContext.

This property is read-only.

IE11

 

Syntax


<body>
  <canvas id="canvas"></canvas>
  ...
<script>
  var gl = document.getElementById("canvas").getContext("experimental-webgl");
  ...
  //  Get canvas associated with gl
  var mycanvas = gl.canvas; 

Property values

Type: HTMLCanvasElement

Current canvas associated with WebGLRenderingContext being used.

See also

WebGLRenderingContext

 

 

Show:
© 2014 Microsoft