Generate random password in javascript
function randomPassword(passwordLength=8)
{
var charsAllowed = "abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ1234567890$.@#%~*";
var len = passwordLength;
var password = "";
while (len--)
{
password+=charsAllowed.charAt(Math.floor(Math.random()*charsAllowed.length));
}
return password;
}
click for more JavaScript codes read about javascript random.