154
rated 0 times
[
161]
[
7]
/ answers: 1 / hits: 66603
/ 10 Years ago, sat, august 2, 2014, 12:00:00
I have an input type=tel
with id=#enter
and I want to add append values from button clicks. I have done this:
$(#one).click(function () {
$(#myInput).val(1);
});
$(#two).click(function () {
$(#myInput).val(2);
});
So every time a button is pressed from #id 1-9 it enters the corresponding numeric value.
However this doesn't append the value in the input field type just replaces the existing value with the value of the button clicked. How can it append the values?
This is the JSFiddle
More From » jquery