Home >Web Front-end >HTML Tutorial >如何制作网页里的文字随时间更改_html/css_WEB-ITnose

如何制作网页里的文字随时间更改_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:14:541955browse

比如现实显示敬业,下一秒就变成自强这两个字了


回复讨论(解决方案)

window.onload = function(){    var test = document.createElement("div");    test.innerHTML = "敬业";    document.body.appendChild(test);    function tab(){        test.innerHTML==("敬业")?(test.innerHTML="自强"):(test.innerHTML="敬业");        setTimeout(tab,1000);    }    tab();}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn