📌  相关文章
📜  如何防止表单自动提交 javascript 代码示例

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

代码示例1
//add event.preventDefault() example,

function clickHandler(event){
    alert("Hey you clicked the submit button");
    event.preventDefault();
}

//this will prevent the page from getting automatically refreshed after 
//the submit button is hit.