ASDV-WebDev/Assignments/JavaScript/lab13js_CalebFontenot/public_html/Problem2.html

30 lines
1.0 KiB
HTML

<!DOCTYPE html>
<!--
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
-->
<html>
<head>
<title>Password Entry</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
//document.body.innerHTML = "a"; // Clear document contents
var password = "";
var promptString = "Please enter a password. Your password must be at minimum 8 characters in length.";
var timesLooped = 0;
do {
if (timesLooped === 1) {
promptString += " Password is under minimum length.";
}
password = prompt(promptString);
timesLooped++;
} while (password.length < 8);
document.write("Password meets criteria. Password accepted!");
</script>
</head>
<body>
</body>
</html>