+ 1

Help me understand.Why does my code "Calculator" work in my browser and not here in the console

12th Mar 2018, 10:22 AM
Andrey
Andrey - avatar
3 Answers
+ 7
Code for question: https://code.sololearn.com/W4x9U3p8e5dz/?ref=app Pretty sure the line: var box=document.getElementById("display"); is being executed before the page is loaded, therefore the element display is not found. This can be fixed by declaring the global variable box as empty and setting it inside a body or window onload function. Here is your code with the changes I mentioned https://code.sololearn.com/WQ3jdxz50l8e/?ref=app
12th Mar 2018, 10:43 AM
jay
jay - avatar
+ 4
https://code.sololearn.com/Wnq4BuoD8aGy/?ref=app
29th Apr 2018, 3:19 PM
Programmer Gaurav
Programmer Gaurav - avatar
+ 1
Thanks!
12th Mar 2018, 10:56 AM
Andrey
Andrey - avatar