Skip to content
Advertisement

How can I echo a statement from a form?

I’m a student doing a challenge where I would have to make a Calculator-type form where you can input two values and click an operation. It’s a simple concept using only 4 operations.

I was able to make the format of the form: title, input text and buttons. But I can’t find a way to take the input information and manipulating the information. My initial goal was to take the two values and adding/subtracting/multiplying/dividing the values and printing the statement above.

For example:

1 + 2 = 3 //statement printed above

First Value: 1 Second Value: 2 //insert values

+ - * / //click operation buttons

Any suggestions?

JavaScript

Advertisement

Answer

This seems to fix the errors I mentioned in comments

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement