Samik,
ссылка на
Учебник вверху
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
window.addEventListener("DOMContentLoaded", function() {
function g(a, c, d) {
for (var b = []; a <= c; a++) b = b.concat(b.splice(Math.random() * b.length | 0, 1, a));
return function() {
return b.length >= d ? b.splice(b.length - d) : b.splice(0)
}
}
function e() {
var a = g.apply(null, f);
d.innerHTML = "";
for (var c = a(); c.length; c = a()) d.innerHTML += c + "<br>"
}
var h = document.querySelectorAll("input"),
d = document.querySelector("div"),
k = document.querySelector("button"),
f = [0, 48, 6];
[].forEach.call(h, function(a, c) {
a.addEventListener("input", function() {
f[c] = +a.value
})
});
e();
k.addEventListener("click", e)
});
</script>
</head>
<body>
<input name="" value="0">
<input name="" value="48">
<input name="" value="6">
<button type="button" >go</button>
<div></div>
</body>
</html>