A simple password generator built with HTML, CSS, and JavaScript.
- Generate passwords of variable length (1-20 characters)
- Include or exclude lowercase letters, uppercase letters, numbers, and symbols
- Display generated password on the page
- Log generated password to the console
- Open the
index.html
file in a web browser - Select the desired password length and character types using the checkboxes
- Click the "Generate Password" button to generate a password
- The generated password will be displayed on the page and logged to the console
index.html
: The main HTML file that defines the structure of the pagestyle.css
: The CSS file that styles the pageindex.js
: The JavaScript file that contains the password generation logic
The password generation logic is contained in the generatePassword
function, which takes the following parameters:
length
: The desired length of the passwordincludeLowerCase
: A boolean indicating whether to include lowercase lettersincludeUpperCase
: A boolean indicating whether to include uppercase lettersincludeNumbers
: A boolean indicating whether to include numbersincludeSymbols
: A boolean indicating whether to include symbols
The function generates a password by randomly selecting characters from the allowed character sets and concatenating them together.
This code is released under the MIT License. See the LICENSE
file for details.