5) In order to draw graphics what is the basic thing which is required?

We need to get the reference for canvas object in JavaScript and for that, we will use “id” of canvas and “document.getElementById” method of javascript.

var canvas = document.getElementById(‘foo’);