HTML Context (Rendering).
The canvas is empty at first. To display something on the canvas element, we need to use a scripting language. The scripting language should access and build on the rendering context.
The canvas element has a DOM methode called getContect(), which is used to get the rendering context and its drawing functions. This methode takes a parameter, the type of context 2D.
The following code is to be written to get the desired context. You can write this script in the body tag, as shown below.