Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

buttonclick-value show in textfield

I want to make a "full" calculator with one button for each number (0-9) and button for each sign (+,-,*,/) etc.

My question is:
How can I show each button-click in the "answere"-textfield?

Example:
If I click button "5", then I want "5" to show up in textfield. Then I click button "+", and then I want "5 +" shall show up in the text field. Then button "2", and then I want "5 + 2" to show up in text field.
And then I will click on button "=" and then I want the textfield to show the answere (7).

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

buttonclick-value show in textfield

Hello Nicklas,

1) Please find the button with css selector and jquery,
2) Save it in the javascript variable
3) Find the input with css selector
4) Place saved variable value into input with jquery

Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

buttonclick-value show in textfield

Thanks for answering.

I haven't understand yet what jquery is, so I evidently have to look at that first :)

Return to “Issues”