Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery text change when input change

How can we do like the bottom, the simple way ?

enter image description here ?

it updates when we change the input.

like image 497
Adam Ramadhan Avatar asked Feb 13 '11 07:02

Adam Ramadhan


1 Answers

Say you had the following HTML:

<input type="text" id="textbox"/>

<span>http://twitter.com/<span id="changeable_text"></span></span>

Your JS would listen for the keyup event.

$('input#textbox').keyup(function() {
   //perform ajax call...
   $('#changeable_text').text($(this).val());
});
like image 110
Jacob Relkin Avatar answered Oct 15 '22 11:10

Jacob Relkin