In a calculator I own 4 input type ="number" in particular:
<input type = "number" id ="mol" min="1" max="4">
<input type = "number" id ="div" min="1" max="4">
<input type = "number" id ="add" min="1" max="4">
<input type = "number" id ="min" min="1" max="4">
In a textbox, I insert the mathematical expression for extended.
<input type = "text" id = "exp" readonly>
The numerical values and the operators have gone through the normal buttons. So, for example, the expression inserted in the textbox is this: 8*5-9/2+3
Now I would want that when I press the equal key, based on the priority that the customer has given to the operands, the expression result changed.
multiplication: 1
division: 4
subtraction: 2
addition: 3
-> 40 - 9 / 2 + 3
-> 31 / 2 + 3
-> 31 / 5
-> = 6.2
I think this is very difficult to achieve. Get the value of the textbox and evaluate the result based on the priority of the operands is really extreme. What do you propose?