+ 1
Final question about the calculator: How do you do the C?
It's supposed to delete the last character, and I don't know how to do it. Pls help! https://code.sololearn.com/W916qpLEF36I/?ref=app
9 Answers
+ 1
its innerHTML not value, sorry.
btw i made a mistake, code above will remove everything but the last đ the opposite of C button.
here fixed
res.innerHTML = res.innerHTML.substr(0, res.innerHTML.length-1);
+ 2
Okay
+ 2
IT'S FINISHED! Thank you so much!!!
+ 1
It says it's not a function
+ 1
Can you give me an example of the code your trying to explain?
+ 1
Hmm, do you know how to make it so when you delete everything, it resets to 0 instead of nothing?
+ 1
whats wrong with set it to "0" ? it should work
0
maybe
str.substr(str.length-1);
there may be another way to do it, but thats what i can think of
0
in your case its need to be res.value
not just res