+ 2
Pleases some one help me with my code
this code has a problem https://code.sololearn.com/WO0OcSXzSKJ4/?ref=app
3 Answers
+ 2
You are trying to get an element with id='print', but you haven't declared any.
So,
var x = document.getElementById("print");
is giving an error,
// Uncaught TypeError: Cannot set property 'innerHTML' of null Line: 22
Just add a
<div id="print"></div>
It'll fix the code.
+ 2
The problem is you never had an element with the id "print".
+ 1
thanks for the help



