How to initialise WebGL

WebGL content is displayed in an HTML canvas element. Use the following code to get a WebGL context for a given canvas.