<body onload="setInterval('generatebutton()',100)" onclick="fclear()">
<script>
var counter = 0;
var state = 0;
function generatebutton(){
if (state == 0){
let arr_ru = ['а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ь', 'ы', 'ъ', 'э', 'ю', 'я'];
var x = document.documentElement.clientWidth;
var y = document.documentElement.clientHeight;
var btn = document.createElement("BUTTON");
btn.innerHTML = String(arr_ru[counter]);
btn.style.position = "absolute";
btn.style.left = Math.floor(Math.random() *x)-25;
btn.style.top = Math.floor(Math.random() *y);
document.body.appendChild(btn);
counter++;
if (counter ==arr_ru.length) counter = 0;
document.body.onselectstart = function() {
return false;
}
}
}
function fclear(){
if (state == 0) {state = 1;}
else {state = 0;}
document.body.innerHTML = "";
}
</script>
</body>
|