This script can generate random password strings of any desired length, the main part is a re-usable JavaScript function which takes the password length as an argument and returns a random password string. This could be used during the account set-up process on a website so make sure that chosen passwords are secure.