I want to type something in a textfield and click a button,and it paste some words,
just like a paste button ,but always paste the same word after the same textfield ,
this is my code,my opinion is when I click the button ,focus is gone so I use blur, its wrong, anybody know how to do?
$('#but1').click(function(){
$('#table1 :text').blur(function(){
var h = 'test';
$(this).val(h+$(this).val());
});
});
<table id="table1" >
<tr>
<td><input type="text" id="text1" size="30"></td>
</tr>
<tr>
<td><input type="text" id="text2" size="30"></td>
</tr>
</table>
<input type="button" value="button" id="but1">
sorry ,I have wrong type here,in my jsp the select ID is correct.