-6

I have one text box and have written "ABC" in the text box, but I want to obtain the text using jQuery

<input type=text value="ABC">

But when I use jQuery's .html() it returns null

Zach Saucier
  • 24,871
  • 12
  • 85
  • 147

1 Answers1

1

Here's a FIDDLE

<input type="text">

<span></span>

$('input').keyup(function() {
  $('span').text($(this).val());
});

or

$('input').keyup(function() {
  $('span').html($(this).val());
});
Milan and Friends
  • 5,560
  • 1
  • 20
  • 28