function generatePassword() {
  var passwordArray = []
  var passwordText = []
  var passwordLength = prompt("How many characters would you like? Password must be between 8-128 characters");
  passwordLength = parseInt(passwordLength);

  if (passwordLength < 8) {
    alert("Password must be at least 8 characters");
    passwordLength = prompt("How many characters would you like? Password must be between 8-128 characters");
  }

  if (passwordLength > 128) {
    alert("Password cannot exceed 128 characters");
    passwordLength = prompt("How many characters would you like? Password must be between 8-128 characters");
  }

  var lowerCaseConfirm = confirm("Would you like to include lowercase characters?");

  if (lowerCaseConfirm) {
    passwordText = passwordText.concat(lowercaseText);
  }

  var uppercaseConfirm = confirm("Would you like to include uppercase characters?");

  if (uppercaseConfirm) {
    passwordText = passwordText.concat(uppercaseText);
  }

  var numConfirm = confirm("Would you like to include numbers?");

  if (numConfirm) {
    passwordText = passwordText.concat(numText);
  }

  var specialConfirm = confirm("Would you like to include any special characters?");

  if (specialConfirm) {
    passwordText = passwordText.concat(specialText);
  }
  
  for (var i = 0; i < passwordLength; i++) {
    passwordArray.push (passwordText[Math.floor(Math.random() * passwordText.length)])
  }
  return passwordArray.join("");
}
// Write password to the #password input
Write password to the #password input
Write password to the #password input
function generatePassword() {
  var passwordArray = []
  var passwordText = []
  var passwordLength = prompt("How many characters would you like? Password must be between 8-128 characters");
  passwordLength = parseInt(passwordLength);
  if (passwordLength < 8) {
    alert("Password must be at least 8 characters");
    passwordLength = prompt("How many characters would you like? Password must be between 8-128 characters");
  }
  if (passwordLength > 128) {
    alert("Password cannot exceed 128 characters");
    passwordLength = prompt("How many characters would you like? Password must be between 8-128 characters");
  }
  var lowerCaseConfirm = confirm("Would you like to include lowercase characters?");
  if (lowerCaseConfirm) {
    passwordText = passwordText.concat(lowercaseText);
  }
  var uppercaseConfirm = confirm("Would you like to include uppercase characters?");
  if (uppercaseConfirm) {
    passwordText = passwordText.concat(uppercaseText);
  }
  var numConfirm = confirm("Would you like to include numbers?");
  if (numConfirm) {
    passwordText = passwordText.concat(numText);
  }
  var specialConfirm = confirm("Would you like to include any special characters?");
  if (specialConfirm) {
    passwordText = passwordText.concat(specialText);
  }
  for (var i = 0; i < passwordLength; i++) {
    passwordArray.push (passwordText[Math.floor(Math.random() * passwordText.length)])
  }
  return passwordArray.join("");
}
function generatePassword ( ) { var passwordArray = [ ] var passwordText = [ ] var passwordLength = prompt ( "How many characters would you like? Password must be between 8-128 characters" ) ; passwordLength = parseInt ( passwordLength ) ; if ( passwordLength < 8 ) { alert ( "Password must be at least 8 characters" ) ; passwordLength = prompt ( "How many characters would you like? Password must be between 8-128 characters" ) ; } if ( passwordLength > 128 ) { alert ( "Password cannot exceed 128 characters" ) ; passwordLength = prompt ( "How many characters would you like? Password must be between 8-128 characters" ) ; } var lowerCaseConfirm = confirm ( "Would you like to include lowercase characters?" ) ; if ( lowerCaseConfirm ) { passwordText = passwordText . concat ( lowercaseText ) ; } var uppercaseConfirm = confirm ( "Would you like to include uppercase characters?" ) ; if ( uppercaseConfirm ) { passwordText = passwordText . concat ( uppercaseText ) ; } var numConfirm = confirm ( "Would you like to include numbers?" ) ; if ( numConfirm ) { passwordText = passwordText . concat ( numText ) ; } var specialConfirm = confirm ( "Would you like to include any special characters?" ) ; if ( specialConfirm ) { passwordText = passwordText . concat ( specialText ) ; } for ( var i = 0 ; i < passwordLength ; i ++ ) { passwordArray . push ( passwordText [ Math . floor ( Math . random ( ) * passwordText . length ) ] ) } return passwordArray . join ( "" ) ; }
Write password to the #password input
Write password to the #password input