0
Please solve the problem
back button and minus button not working https://code.sololearn.com/Wt2KQmvqUu19/?ref=app
1 Answer
+ 4
This buttons don't work because character/symbol is not same as character you are testing in javascript. For minus it is just visually same.
You can use this site to get html entity codes or unicode values:
https://www.compart.com/en/unicode/U+002D
Here is fix for this 2, also in logic for back button, you are setting "button" to 0, but it need to be "buffer"
There are also few others bugs, but I think you didn't finished code, if you have other question fill free to ask.
I used "<" as back button(didn't find better character), but it will be much better if we would use words, like having id to elements, and use this id as symbol not using element.innerText, in that way you can use anything even images or icons for UI and have working code.
https://code.sololearn.com/WaoA3x3wB0Gr/?ref=app