a good tutorial-ish page on a simple calculator:
http://www.anaesthetist.com/mnm/javascript/calc.htm
make sure you read it, understand it, but don't copy/paste it.
do it yourself, in your own code, your own way. understand it, why it works, and make it yours.