javascripが実現するシンプルユーザー登録

710 ワード

<html>
	<head>
		<title>document.write</title>
		
		<script>
		
			for(var i = 0; i < 3 ; i++){
					var username = prompt("       ","");
					var password = prompt("       ","");
					
					//            equal,    == 
					if("zhangsan" == username && "123" == password){
						alert("    !!");
						break;
					}else{
						if( (2 - i) == 0){
							alert("     ,      !!");
						}else{
							alert("    !!   "+(2 - i) + "  !");
						}
					
						
					}
			}

			
		</script>

	</head>
	
	<body>
	
	</body>

</html>