it works, but I don’t know where it wants the result to be displayed since it’s fine for the other tests. I tried switching their places but that made things worse; tried without one or the other, still not good.
This one’s trickier because I can’t figure out how to compromise.
They want:
5*-+5=10
5*-5=-25
Don’t know how to make both work without cheesing it specifically for the test.
Tried the second one on Windows’ calculator and it does the same thing my calculator does, replaces the “*” with a “-”, so the result is 0.
Before every test, I hit Clear. That’s my only theory on why the tests are coming out negative, they’re not clearing previous tests or doing it differently.
Any help or feedback is greatly appreciated, been stuck for a couple of days now and I’m out of ideas.
Thanks
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0
Challenge Information:
Front End Development Libraries Projects - Build a JavaScript Calculator
Do you have the code with a working click handler and one that just sets it to yes/error?
I don’t think you want to use input elements for the readouts. I assume the tests are looking at the text content of the elements (and not the value attribute).
<form>
<p id="display" style={{ color: "white" }} type="text">
{result}
</p>
{/* shows result once = is hit */}
<p id="displayFormula" style={{ color: "orange" }} type="text">
{formula}
</p>
That didn’t change anything, but thank you.
I don’t understand your first question. The click handler works as far as I can tell, at least when I’m individually testing the app. Something only breaks when the FCC Test Suite runs.
Thanks for the reply
I’m actively working on it, maybe you caught a glimpse when I accidentally saved or it auto-saved (I don’t save when I tinker but something must’ve happened, maybe I unconsciously hit ctrl+s at some point), and had to find an old copy and restore it.
I'm very new to this, how do I downgrade?
Thanks!
Edit: nvm, figured it out, but thanks a million for that . It’s been driving me insane why it wouldn’t work