How to get text box value in javascript

Jacob
Jacob
Member
56 Points
13 Posts

Hi,

I want to get text box value on change .

thanks..

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

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
Teacher
4822 Points
23 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