Sunday, 28 July 2013

Jquery - Get the TextBox value on Change event and Store in another TextBox

Now we see how to get the value of  TextBox on change event using JQuery.

Now we the Html code In the below code, Two TextBox are created.

     <script src=""></script>
    <meta charset=utf-8 />
        <title>JS Bin</title>
   <input type="text" id="txt1" />
   <input type="text" id="txt2"/> 

Now Let we see the JQuery Code to access the Textbox, Jquery code is written for the textbox object with id of txt1, On change Event.


  var result = document.getElementById('txt1').value;
  document.getElementById('txt2').value = result;


Click Here to See Full Source code
Click Here to see the Output