preventDefault in Safari

后端 未结 3 878
轮回少年
轮回少年 2021-01-25 16:53

I have a textbox which has the code;


Now there is no e

3条回答
  •  清酒与你
    2021-01-25 17:15

    Just to be sure, terminate your callback function with a return false. That should do the trick.

     function(e) {
         e.preventDefault();
         // some awesome code
         return false;
     }
    

    Oh, and another thing: in the future, to avoid such random behavior.. respect the standards, use a form :)

提交回复
热议问题