Skip to content

Prompts enable the user to select password criteria and a password is generated

Notifications You must be signed in to change notification settings

prisc-e/Password-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Password-Generator

This website generates a randomized password based on user criteria. When the button is clicked, prompts enable the user to enter how many characters the password will be and what kind of characters it will have. A password is then generated.

Additions:

In the generatePassword() function, I added if/else statements to handle user input for the window prompts and sent alerts if the input was not valid for the question. I also added an if/else with a window.alert for if the user entered all no's for the character options.

I added arrays for the uppercase, lowercase, special, and numeric characters. A while loop with the Math.random method loops through the character arrays that were selected. The random characters were then added to the "passString", and the string was returned at the end of the loop. The writePassword() function then displays the password string onto the user's screen.

After selecting a 12 character password: image

After also typing "yes" to all character options: image

User enters invalid input: image

Alert after invalid input: image

Alert after user enters "no" for all character options: image

Updated By Priscilla Egli

About

Prompts enable the user to select password criteria and a password is generated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published