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

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

WBOY
Release: 2016-06-24 11:14:54
Original
1948 people have browsed it

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


回复讨论(解决方案)

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();}
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template