how to auto populate text fields with text automatically

I have a simple Registration form and I want to make an option like there are two different fields, and what i want is simple, just when I add text to the first field it should automatically be added the same content to the next field.




    $('#txt1').on('change', function(e){


The change event only fires when 2 conditions are met:

  • The element loses focus;
  • The element has a different value property than when it got focus.

If you want the text to change as you type it, you can use jQuery together with the HTML5 input event:

//assuming `a` and `b` as text field IDs
$('#a').on('input', function() {


For non-HTML5 browsers, you can just extend the events map to simulate the input event:

$('#a').on('input keydown keypress keyup change blur', function() {


Give onchange event for first field and assign value for second field,as below


Need Your Help

How to correct character encoding in IE8 native json?

javascript json internet-explorer unicode encoding

I am using json with unicode text, and am having a problem with the IE8 native json implementation.

Why does newList = list.remove(x) return None?

python syntax

I have a list below and I want to remove a value and set it to a new variable. Why does it return None?