function genPassword() {
var chars = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var passwordLength = prompt("Length:Enter a number between 8-128");
var specialcharacters = prompt("Would you like special characters?");
var numeric = prompt("Would you like numbers?");
var upper = prompt("Would you like uppercase?");
var lower = prompt("Would you like lowercase?");
var password = "";
for (var i = 0; i <= passwordLength; i++) {
var randomNumber = Math.floor(Math.random() * chars.length);
password += chars.substring(randomNumber, randomNumber +1);
}
document.getElementById("password").value = password;
}
When i click my generate btn i should get 5 prompts and the prompts should us that info to create the password like 8(for length), yes, no, no, yes.
chars
chars
chars
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.