A simple JavaScript calculator

Joined
Feb 27, 2005
Messages
940
Reaction score
59
Points
28
Location
Framingham, MA
Your Mac's Specs
MacBook C2D 2.4 2GB
I need a very simple and small HTML document with JavaScript, basically a simple calculator, that asks for two values (x and y), adds them and shows the result, as simple as possible.
If anyone has the time to do this i would really appreciate it. I know there are plenty of sites with more complex examples, but i need an extremely simple one. Thanks!
 
Joined
Jan 8, 2005
Messages
2,789
Reaction score
84
Points
48
Location
A religiously oppressed state
Your Mac's Specs
17" MacBook Pro
Hold on.. typing it up now....
 
Joined
Jan 8, 2005
Messages
2,789
Reaction score
84
Points
48
Location
A religiously oppressed state
Your Mac's Specs
17" MacBook Pro
I read your post wrong and did it with PHP code. PHP is much simpler and I suggest just using PHP unless you need javascript specifically for this. Here are my instructions...

Again sorry for my mistake.
 

Attachments

  • PHP.rtf.zip
    1.1 KB · Views: 14
OP
mraya
Joined
Feb 27, 2005
Messages
940
Reaction score
59
Points
28
Location
Framingham, MA
Your Mac's Specs
MacBook C2D 2.4 2GB
Thanks a lot for the file, it does look simpler than JavaScript, but i need JavaScript. I need to do some calculations, just simple math for cell culture, basic chemistry and some protocols. JavaScript gives me the flexibility i need plus eventually i may be able to turn it into a widget and/or transfer it to a PDA.
I'm not familiar with PHP, although it seems simpler i believe it may not give me the compatibility i need later. Anyway, thanks again for your fast answer.
 
OP
mraya
Joined
Feb 27, 2005
Messages
940
Reaction score
59
Points
28
Location
Framingham, MA
Your Mac's Specs
MacBook C2D 2.4 2GB
Thanks a lot giulio!!!
 
Joined
Mar 19, 2007
Messages
1,814
Reaction score
137
Points
63
Location
NY USA
Your Mac's Specs
iMac 5.1 | iMac 7.1 | iMac 12.1 | iMac 19.1 | iPhone 11 Pro | Watch s5
you're welcome :)
 
Joined
Feb 17, 2009
Messages
1
Reaction score
0
Points
1
calculator

hi looking for a simple calculator with an item name box: and amount
to simple add another item named box: and another:
like this ...{two cold pies} £1.23 + {three cold pies}£1.26 + {two sandwiches} £1.10 = total the one that is posted in a zip file nearly does it. can anybody help????
Equinox
 
Joined
Feb 23, 2009
Messages
1
Reaction score
0
Points
1

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top