我再网上看的例子  说这个不会提交过去  为什么我试了能提交呢?
我把form的onsubmit直接改成"return false"这样提交不过去  但是例子里面的可以提交过去  网上也有很多这样的例子 我试了怎么能提交过去呢?这是为什么?我没有用过阻止表单提交的方法
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script type="text/javascript">
    function check(){
      return false;
    }
</script>
</head>
<body>
<form onsubmit="return check()">
<input type="submit" value="点击表单不会提交" />
</form>
</body>
</html>
                            
                                    Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
onsubmit="check()" 就可以了
<form onsubmit="return check()"> 肯定不会提交,
这个相当于<form onsubmit="return false">
<form onsubmit="check()"> 这个会提交