How to get text box value in javascript

Jacob
Jacob
104 Points
14 Posts

Hi,

I want to get text box value on change .

thanks..

Views: 8687
Total Answered: 1
Total Marked As Answer: 0
Posted On: 26-Jul-2015 08:33

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
4960 Points
31 Posts
         

Hi Jacob,

You can do this by using small amount of jquery.

Suppose you have following input field and a label to show the text box value:

<input type="text" name="textdemo" />
<label id="lbldemo">---</label>

Then On page ready state do following jquery code:

$('input[name="textdemo"]').change(function(){
 $('#lbldemo').html($('input[name="textdemo"]').val());
});

 

Posted On: 26-Jul-2015 09:03
 Log In to Chat