Відмінності між версіями «Test2»

нема опису редагування
Мітка: Скасовано
Рядок 21: Рядок 21:
window.onload = function typeWriter() {
window.onload = function typeWriter() {
   if (i < txt.length) {
   if (i < txt.length) {
     document.getElementById("typewriter").innerHTML += "<span>" + txt.charAt(i) + "</span>";
     document.getElementById("typewriter").innerHTML += txt.charAt(i);
    txt = txt + "<span class='test'>"+String.fromCharCode(event.which)+"</span>";
     i++;
     i++;
     setTimeout(typeWriter, speed);
     setTimeout(typeWriter, speed);