+ 5

Error after move code from Codepen.io to Sololearn code playground?? Why?

After writing some code in codepen.io, I decided to share my code in sololearn. But after I run it, i found error but can't understand why it happened. Thank you. my code: https://code.sololearn.com/WRaOiCO6ZMcO/#html

10th Jan 2018, 9:15 AM
Tran Huu Dang
Tran Huu Dang - avatar
2 Answers
+ 6
Try var box; window.onload = function() { box=document.getElementById("boxControl"); } function calculate(){ var x=document.getElementById("result"); x.innerHTML=eval(box.value); } function numberClick(itsID){ var addNumber=document.getElementById(itsID); box.value+=addNumber.value } function deleteNumber(){ var textF= box.value; var textE= textF.slice(0,textF.length - 1 ); box.value= textE; }
10th Jan 2018, 9:28 AM
CalviŐČ
CalviŐČ - avatar
+ 4
wow, thank you so much
10th Jan 2018, 10:17 AM
Tran Huu Dang
Tran Huu Dang - avatar