3
rated 0 times
[
5]
[
2]
/ answers: 1 / hits: 9965
/ 11 Years ago, mon, december 16, 2013, 12:00:00
Let me show you a piece of my code so you know what I'm struggling with.
<input type=text id=input />
This is the input element I am talking about. What I want to do is put the value of :
<input type=button id=b1 value=1 />
in the textbox everytime the button is clicked.
A side question I can't google because it's part of searching syntax.
What is the difference between and
''
(with something in-between) and when do you use one of them?
EDIT: Right now the click event is adding the value of the button to the textbox. But not to the text inside the textbox! IT just literally adds it, as if the textbox is a division or something.
The jquery/javascript code
$(#b1).click(toev);
function toev(){
$(#input).text($(append($(this).val())));
};
More From » jquery