zoukankan      html  css  js  c++  java
  • 阻止表单提交刷新页面的问题

    <!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;
    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>

  • 相关阅读:
    手机文件夹的emulated什么意思
    数据结构
    Django简介
    forms组件
    前端css
    mysql进阶知识
    mysql入门知识
    html文档知识补充
    前端基础
    python 面试题
  • 原文地址:https://www.cnblogs.com/zhangq/p/9082578.html
Copyright © 2011-2022 走看看