0

Calculator

My buttons are not working of the calculator when I press the buttons https://sololearn.com/compiler-playground/WG2rV3Q95aSC/?ref=app

16th Oct 2025, 5:06 PM
Syed Hunain Ali
Syed Hunain Ali - avatar
2 Antwoorden
+ 2
Did you write this ode by yourself?? Line 6 of JS: "element" is not defined. It iterator is "buttons" according to line 4. Line 19 of JS: There is no html element with that id? JS can only access the html elements once the DOM is fully loaded. You can, for instance, wrap all your JS in window.onload = () => { ... }
16th Oct 2025, 5:21 PM
Lisa
Lisa - avatar
0
your id is wrong in the html. you have an empty space between input and Box: <input type="text" id="input Box" value="0" placeholder="0" disabled> also: string = eval(string) instead of string = string(eval(string)) but also don't use eval as much as possible...
16th Oct 2025, 10:13 PM
Bob_Li
Bob_Li - avatar