📌  相关文章
📜  防止表单提交 html javascript jquery - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:08.400000             🧑  作者: Mango

代码示例3
// BEST OPTION
    JUST:
* delete the  in the friggin FORM and add  with the same style instead, THE FORM WONT BE SUBMITTED THIS WAY. 
* REMOVE THE action="" and method="" tags, and replace them in JQUERY\JS fetch() or $.ajax() functions!

** VOILA **

    //option B
    $("form").submit(function(e){
        e.preventDefault();
    });