Copy another textbox value in real time Jquery

后端 未结 5 637
臣服心动
臣服心动 2021-01-06 09:30

I want to get the value of another textbox and input it in realtime into the other textbox. HOW CAN I DETECT IF TEXT_3 WAS CHANGED? IF TEXT_3 VALUE CHANGED, IT MUST BE INPU

5条回答
  •  無奈伤痛
    2021-01-06 09:49

    the change event fires after the input field has lost it's focus. If you want to update it in realtime you also need the keyup event, so something like this:

    $("#text_3").keyup(function(){
        $("#text_4").val($("#text_3").val());
    })
    

提交回复
热议问题