首页 > 其他 > 详细

阻止表单提交刷新页面的问题

时间:2018-05-24 14:21:30      阅读:396      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>
Marker Animation
</title>
<style type="text/css">
html, body, #map, #form1 {
margin: 0;
padding: 0;
width: 100%;
height: 80%;
}

body, div, ul, li {
margin: 0;
padding: 0;
}
</style>

</head>
<body>
<form method="post"  id="form1">

 <button id="start-animation">Start Animation</button>

  <script>

 var startButton = document.getElementById(‘start-animation‘);

function startAnimation() {
event.preventDefault();

}

startButton.addEventListener(‘click‘, startAnimation, false);

</script>

<form>

 

阻止表单提交刷新页面的问题

原文:https://www.cnblogs.com/zhangq/p/9082578.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!