Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

can anyone help me with jjavascript, how to make a simple calculator using the documentgetid

OpenStudy (anonymous):

http://www.sciencebuddies.org/science-fair-projects/project_ideas/CompSci_p001.shtml First result in Google for "simple calculator in javascript". Seems like a good start. I'm sure you could implement that and expand on it as needed.

OpenStudy (amistre64):

hmmm ..... coding up the interface should be simple enough; the tedious part would be in scripting in an event listener and deciding what to do when keys or combonation of keys are pressed

OpenStudy (amistre64):

then script up a function that writes the input into a variable to solve for perhaps

OpenStudy (amistre64):

something based on this perhaps? <html> <body onkeyup="getKeys()"> </body> <script language=javascript> var keys=new Array() var k=1 function getKeys() { keys[k]=window.event.keyCode k = k+1 } function calculate() { for (j=1;j<keys.length;j=j+1) {parse the information} display the information } </script> </html>

OpenStudy (anonymous):

many thanks, i will try it out and reply

OpenStudy (amistre64):

if you type up some the html, save it, and attach it to the post; we can see what direction you are going in :)

OpenStudy (anonymous):

Please attach your code next time. That would be nice.

OpenStudy (anonymous):

i have done a bit, but i cant get it to equals and give the answer

OpenStudy (anonymous):

did u get the code?

OpenStudy (amistre64):

if you attach the file, .txt or .html doesnt matter, to the post; we can look thru it, give options, debug it, and help out more :) just use the "Attach File" option that is located at the bottom of the screen under the reply box.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!