<div style="display: none;" id='divTestDisplay'>我要显示的文字</div> window.onload = function () { setTimeout(show, 500); } //显示 function show() { document.getElementById('divTestDisplay').style.display = "block"; setTimeout(hide, 500); } //隐藏 function hide() { document.getElementById('divTestDisplay').style.display = "none"; setTimeout(show, 2000); }