+ 2

Pleases some one help me with my code

this code has a problem https://code.sololearn.com/WO0OcSXzSKJ4/?ref=app

1st Jul 2017, 7:46 PM
Chi Karl
Chi Karl - avatar
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.
1st Jul 2017, 9:12 PM
Salekin
Salekin - avatar
+ 2
The problem is you never had an element with the id "print".
1st Jul 2017, 8:17 PM
Pedro Cruz
Pedro Cruz - avatar
+ 1
thanks for the help
2nd Jul 2017, 6:57 AM
Chi Karl
Chi Karl - avatar