-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
  • 23,662
  • 12
  • 81
  • 137

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());
});
mdesdev
  • 5,492
  • 1
  • 17
  • 28