Can i prevent blur event from happening?

后端 未结 4 1444
我在风中等你
我在风中等你 2021-01-08 01:25

I have a simple example where i have an input field and i put a blur and change event on it:

HTML

<         


        
4条回答
  •  孤独总比滥情好
    2021-01-08 01:51

    Solved issue by this..

     $('input').change(function(e){
      alert('change'); 
       e.stopImmediatePropagation();
       $(this).off("blur");
     });
    
    $('input').focus(function(e){
       $(this).on("blur", function(e){
       e.stopImmediatePropagation();
       e.preventDefault();
      alert('blur'); });
    });
    

提交回复
热议问题