KopBuH,
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Личный сайт студента GeekBrains</title>
<script type="text/javascript">
var mass = ["A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "Q", "q", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "W", "w", "X", "x", "Y", "y", "Z", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9","0"];
function readInt(id){
var number = document.getElementById(id).value;
return parseInt(number);
}
function getRandomNumber(max){
return Math.round(Math.random() * max);
}
function write(text){
document.getElementById("info").innerHTML = text;
}
function hide(id){
document.getElementById(id).style.display = "none";
}
function generateText(letters, length){
var pass = "";
for (var i = 0; i < length; i++){
var n = getRandomNumber(letters.length - 1);
pass = pass + letters[n];
}
return pass;
}
function create()
{
var length = readInt("userAnswer");
if(!length) return;
var text = generateText(mass, length);
hide("userAnswer");
write(text);
}
</script>
</head>
<body>
<div class="content">
<div class="header">
<a href="index.html">Главная</a>
<a href="puzzle.html">Загадки</a>
<a href="guess.html">Угадайка</a>
<a href="#">Генератор паролей</a>
</div>
<div class="contentWrap">
<div class="content">
<div class="center">
<h1>Генератор паролей</h1>
<div class="box">
<p id="info">Какой длины сгенерировать пароль?</p>
<input type="text" id="userAnswer">
<br>
<a href="#" onClick="return create();" id="button">Сгенерировать</a>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
Copyright © GORO
</div>
</body>
</html>