+ 9
The reason of the error is a bug on SoloLearn playground in android. They decided to run js first for some reason.. that's why the js looks for HTML elements which doesn't exists yet, and that's why error happens. So make the JS wait for elements to load, use this:
``onload = () => {} `` just like Bob_Li said for that.
+ 3
Zvi
Android app users gets error messages without the onload hack.
+ 2
in your js, put display variable assignment inside onload function.
onload = () => {
let display =
document.getElementById('display');
}
0
Works perfectly for me.
Gorgeous calculator, by the way.
0
Thé Tim Burton
0
Hello bro.
0
hello
0
If you're using the playground, the error message usually gives a clue about what's wrong. It might say something https://www.ssmsmart-square.com like "Unexpected token," which means something is out of place.