+ 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
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;
}
+ 4
wow, thank you so much