Fire Jquery text change when selecting prefilled value

前端 未结 1 930
遥遥无期
遥遥无期 2021-01-21 20:29

I am copying over firstname into lastname field. This works well with new names on the page. However, after entering a few names the browser shows the history of names and if th

相关标签:
1条回答
  • 2021-01-21 20:33

    Don't rely on change event at this situation, prefer input event. Because change event only get triggered when the focus got blurred out from the particular text box.

    $(document).ready(function() {
        $("#FName").on('input',function() {
          $("#LName").val(this.value);
        });
    });
    
    0 讨论(0)
提交回复
热议问题