How to return true or false in javascript function?

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>

 

<input type="button" onclick="return func1();" />

function func1()
{
 // do something
return false;
}

2021-10-03