Minifycode 2020-02-12 Viewed 1K times Javascript

In this article, you will learn how to return true or false in javascript function

<script type="text/javascript">
    $("#btnSubmit").click(function () {
        var txtEmail1 = $("#txtEmail").val();        
        if (txtEmail1 == '') {
            txtEmail.focus();
            return false;
        }
        else if (txtPassword1 == '') {            
            return true;
        }              
    });
</script>

Return true or false in javascript function
minify code