Help!

hi can you help me with this code whenever i try it it just goes on forever instead of breaking.

<head>
    <title>
    Help 
    </title>
    <script>
        function login(){
            var password=window.prompt("What is your password");
            var cnfrpss=window.prompt("Confirm Password ");
            if(password==cnfrpss){
                document.write("You are ready to start the quiz");
                document.write("<button>begin</button>");
            }
            else{
               for(var x=1;x<=10000000;x++){
                   var cnfrmpss2=window.prompt("Please confirm your password");
               }
               if(cnfrmpss2==password){ document.write("thank you for your co-opperation")
                   break;
               }
            }
        }
    </script>
</head>
<body>
    <button onclick='login()'>
        Start Login
    </button>
</body>
2 Likes

the code that could possible trigger a break is not nested inside the loop

5 Likes