Page 1 of 1

buttonclick-value show in textfield

Posted: Thu Feb 05, 2015 8:26 am
by Nicklas

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).


buttonclick-value show in textfield

Posted: Thu Feb 05, 2015 10:37 am
by Evgene Karachevtsev

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


buttonclick-value show in textfield

Posted: Fri Feb 06, 2015 9:36 am
by Nicklas

Thanks for answering.

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