assets/scripts/script.js
// Write password to the #password output
Write password to the #password output
Write password to the #password output
function writePassword(event) {
  event.preventDefault();
  const password = generatePassword();
  if (password === "") {
    passwordText.value = "Please select at least one password criteria option";
  } else {
    passwordText.value = password;
    alertUser();
  }
}
function writePassword ( event ) { event . preventDefault ( ) ; const password = generatePassword ( ) ; if ( password === "" ) { passwordText . value = "Please select at least one password criteria option" ; } else { passwordText . value = password ; alertUser ( ) ; } }
Write password to the #password output
Write password to the #password output
// Prevent page refresh on button click // Generate the password // Populate the text area with the password and alert user if needed