U have to use JavaScript for calculations.
There is a function 'eval' in JavaScript that takes the operators and operands as input and returns the result.
E.g: eval(7*5), it will return 35.
2006-11-27 18:01:44
·
answer #1
·
answered by Vaibhav 4
·
1⤊
0⤋
You can't use just HTML to create a calculator, you need to use javascript or some other dynamic language to create a calculator. HTML is a static markup language.
To create a basic calculator, have a form that lets you choose a function (+,-,*,/) (possibly as radio buttons), two fields for putting in numbers, a field for a result, and then a button that will call the javascript function that will start the calculation based off of the information in the form.
Have the javascript get the values and the function, perform the calculation, then change the result form to show the result.
2006-11-28 01:30:54
·
answer #2
·
answered by Bryan A 5
·
1⤊
0⤋
Learn and use php. The calculator is then server side. Web designers should not take control of clients' computer (IMO).
2006-11-28 01:47:28
·
answer #3
·
answered by Anonymous
·
0⤊
0⤋