I can not get the calculator to work properly

Tell us what’s happening:
Describe your issue in detail here.
i can not satisfy all of the tests, and i am exhausted.
this is my codepen:

Challenge: Build a JavaScript Calculator

Link to the challenge:

1 Like

I think the display id needs to be on the element that is actually doing the displaying. Right now you have an <h2> doing the displaying and the display id is on the <div> that wraps it. I would get rid of the <h2> (it doesn’t make sense to use it here) and just use the <div> to do the display. If you really want to be semantically correct then I think the <output> element might be a good option here.

Not saying this is going to solve all of your problems but I’m pretty sure this is necessary.

Also, none of the operator buttons (+, -, *, /) seem to work.

1 Like

Thanks for your suggestions! I just tried the operators and they worked after you press the = sign., except the -, because of the situation. i’ve been on it for more than 7 hours and i can not find a fix.

This is not my experience. I cannot get them to work at all. You will have to be very detailed about exactly what you are doing to get them to work.

Regardless, you should not have to do anything to get them to work. Clicking 5 + 5 = should give you 10 the first time you try it :slight_smile:

Also, I think if you open up the Console in your browser’s dev tools you might see some helpful information when you click on one of the operator buttons.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.