www.richandlucy.com © www.richandlucy.com
Home | Photos | Stuff | Forum

> Stuff > Lucy's Portfolio! > Javascript Example 3

Create a Web Page of a simple calculator.

You will need:

A form containing

  • 11 buttons numbered "0"-"9" and "."
  • 4 buttons for the operators "+", "-", "*", "/"
  • 1 button for "="
  • 1 button to clear the calculations
  • An input box called result
  • A runningTotal variable
  • A currentOperator variable
  • A currentNumber variable
  • An onClick function for each button

You can use image rollovers instead of buttons if you want.


You can see the page created here - I'm not sure if this is the finished article, but it seems to work okay!


2 3 4 5 6 7 8 9 10 11 12 13
© www.richandlucy.com - 2004 All content created and owned by www.richandlucy.com | Contact us