1var canvas = document.getElementById("canv");
2var ctx = canvas.getContext("2d");
3ctx.fillStyle = "red";
4ctx.fillRect(10, 10, 80, 80);
1The HTMLCanvasElement.getContext() method returns a drawing context on the
2canvas, or null if the context identifier is not supported, or the canvas has
3already been set to a different context mode.
4Later calls to this method on the same canvas element, with the same contextType
5argument, will always return the same drawing context instance as was returned
6the first time the method was invoked. It is not possible to get a different
7drawing context object on a given canvas element.