function generateRandomString(len) { var randomString = ""; for (; randomString .length < len; randomString += Math.random().toString(36).substr(2)); return randomString.substr(0, len); }; alert(generateRandomString(25));