javascript - How to make a text that changes and animates? -


i practicing html , css, along basic javascript. want make text changes after period like:

i hello

ii hello ii

iii hello iii

or that, idea. want change after small period half second. after searching internet , stackoverflow, haven't found solution yet. can direct me on how properly?

use setinterval , below function that:

var el = document.getelementbyid("foo");  var countofi = 1;  setinterval(function() {    if (countofi > 10) countofi = 1;    var = new array(countofi).fill('i').join("");    el.innerhtml = + " hello " + i;    countofi++;  }, 500)
<div id="foo"></div>


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -