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
Post a Comment