TUTORIAL : Typewriter

Advertisement

TUTORIAL : Typewriter


Typewriter? Apa tu? Mesti korang tertanya-tanya kan? Contoh dia macam kat bawah ni

Typewriter


<button onclick="typeWriter()">Click me</button>
<p id="demo"></p>
<script style= "text/css">
var i = 0;
var txt = 'TEKS SINI';
var speed = 50;
function typeWriter() {
  if (i < txt.length) {
    document.getElementById("demo").innerHTML += txt.charAt(i);
    i++;
    setTimeout(typeWriter, speed);
  }
}
</script>

Post a Comment

0 Comments