const gl = canvas.getContext("webgl", {
antialias: false,
depth: false,
});HTMLCanvasElement: getContext() method / notebook
HTMLCanvasElement: getContext() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<canvas id="canvas" width="300" height="300"></canvas>const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
console.log(ctx); // CanvasRenderingContext2D { /* … */ }