This is a simple utility that would allow users to randomly generate a password with length of 8-128 digits, from a selected pool of characters, including lower case letters, upper case letters, special characters, and numeric values.
There are few functions in the script.js file.
btn.onclick
event will call function to set the display property of the form modal to"block"
, basically from hidden to visiblesetCriteria()
is called when Confirm button is clicked, then form values are passed to predefined variables, and will callcheckCriteria()
functioncheckCriteria()
function will check whether use typed in a number that's within 8-128 range, and at least one of the character pools is selected, this function will returnfalse
if criteria is invalid, and returntrue
is validwritePassword()
function will be executed ifcheckCriteria()
returnstrue
, and starts to callgeneratePassword()
as well as closing the modal, displaying the password, copy to clipboard, and alert window messagegeneratePassword()
is the one that generates the password text given the length, character pool selection