Reputation: 31397
I want to display changing text into another text box
I tried here for evey possible combination. But didn't work.
/*$('input#list_val').keyup(function() {
//perform ajax call...
// alert("Hello");
$('#list_v').text($(this).val());
});*/
$('input#list_val').keydown(function() {
//perform ajax call...
//alert("Hello");
$('#list_v').text($(this).val());
});
<input type='text' id="list_val" />
<input type='text' id="list_v" />
Upvotes: 1
Views: 2955
Reputation: 3353
Your code is perfect, Just need to change small things in your code :
$('#list_val').keydown(function() {
$('#list_v').val($(this).val());
});
Upvotes: 0
Reputation: 1011
Try this:
$('input#list_val').keydown(function() {
var text = $("input#list_val").val();
$('#list_v').html(text);
});
Upvotes: 0
Reputation: 374
Try This
js
$('#list_val').keyup(function() {
$('#list_v').val($('#list_val').val());
});
Upvotes: 0
Reputation: 388316
var $list_v = $('#list_v');
$('input#list_val').keyup(function() {
$list_v.val($(this).val());
});
Demo: Fiddle
Upvotes: 0
Reputation: 1652
change from :
$('#list_v').text($(this).val());
to:
$('#list_v').val($(this).val());
Upvotes: 0