JQuery - Duplicate Field Input Text In Real Time

前端 未结 5 2064
盖世英雄少女心
盖世英雄少女心 2020-12-23 23:39

I\'m trying to figure out how to copy a users text input in one form field to another. Specifically, when someone fills in their email address in the contact form, it will b

5条回答
  •  囚心锁ツ
    2020-12-24 00:28

    use keyup and change both.

    $("#boxx").on('keypress change', function(event) {
           var data=$(this).val();
           $("div").text(data);
    });
    

    here is the example http://jsfiddle.net/6HmxM/785/

提交回复
热议问题