Why does the following code not work?
As soon as I click on the submit button it refreshes the page.
I have just started learning JavaScript, so if you have any suggestions to improve my knowledge about JS feel free to share those also.
<html>
    <head>
        <title>Form </title>
        <script src="form.js"></script>
    </head>
    <body>
        <form id="Form" onsubmit="return handleSubmit()">
            <input id="username" type="text" name="username ">
            <input id="password" type="password" name="password">
            <input id="submit" type="submit" name="Login">
        </form>
    </body>
</html>
function handleSubmit(){
    console.log("Hi");
    var form = document.getElementById("Form");
    console.log("va="+form.childern[0].value);
    var u = form.childern[0].value;
    if (form.childern[0].length==0 && isNaN(typeOf(u))==true){
        alert("Enter Correct username");
    } else {
        console.log("username = " +u);
    }
    return false;
}