hey guys...
last nite i made a calculator using javascript...the only prob m having is that m not able to make memory in the calculator.
memory means MR,MS
MS-->is used to store the displayed no
MR-->recall the stored no

PLEASE HELP

Recommended Answers

All 3 Replies

Javascript has variables, no? You can use them to maintain the state of your calculator app.

but whenever i store the value in the text box in the variable it overwrits whn the value of the text box is changed....

There are numerous ways you can do it. You can have one variable specifically for the previous value. So just before you assign a new value to the textbox, assign the current value that is in the textbox to your history variable, then insert the new value into the textbox. You can even do this in an array and store the, say previous 20 values in an array.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.