onsubmit()return true和true的问题

<script>
    function checkSub() {
        var isOK=false;
        return isOK;
    }
</script>
<body>
    <form onsubmit="return checkSub()" action="checked.html">
        <input type="submit">
    </form>
</body>

这时点击提交按钮是不可以提交表单的

<form onsubmit="checkSub()" action="checked.html">
    <input type="submit">
</form>

这时点击提交按钮是可以提交表单的

 

猜你喜欢

转载自blog.csdn.net/qq_37687883/article/details/81111470
今日推荐