Masz to ci wygeneruje hasełko ;)
<!DOCTYPE html>
<html lang="pl">
<head>
<title>Generowanie hasełka</title>
<meta charset="utf-8">
<style>
</style>
</head>
<body>
<span id="pass"></span>
<script>
var charCount = (Math.floor(Math.random()*5)+10);
var newPass ='';
console.log(charCount);
for(var i = 0; i <= charCount; i++) {
passChar = String.fromCharCode(Math.floor(Math.random() * 58) + 65);
newPass += passChar;
}
document.getElementById('pass').innerHTML = newPass;
</script>
</div>