表单提交的方法。

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <form action="http://www.jb51.net">
        <input type="text" />
        <input type="submit" value="submit" onclick="return validate()" />
    </form>
</body>
<script type="text/javascript">
    function validate() {
        if (confirm("提交表单?")) {
            return true;
        } else {
            return false;
        }
    }
</script>

</html>

 

posted @ 2017-11-20 11:16  莫笑我胡为  阅读(224)  评论(0编辑  收藏  举报