Detecting input change in jQuery?

后端 未结 8 2238
Happy的楠姐
Happy的楠姐 2020-11-22 04:11

When using jquery .change on an input the event will only be fired when the input loses focus

In my case, I need to make a call to the serv

8条回答
  •  一整个雨季
    2020-11-22 04:37

    // .blur is triggered when element loses focus

    $('#target').blur(function() {
      alert($(this).val());
    });
    

    // To trigger manually use:

    $('#target').blur();
    

提交回复
热议问题