0 votes
in HTML by

How do you place a canvas element with an ID of canvas1 into a JavaScript variable?

1. var canvas1 = document.getElementById('canvas1'); 

2. var canvas1 = getElementById('canvas1');

3. var canvas1 = document.getElement('canvas1');

4. var canvas1 = document.get('#canvas1');

1 Answer

0 votes
by
Correct answer is :- var canvas1 = document.getElementById('canvas1');
...