<p id="pop" style="display:none; background-color:#D1D1D1; border: 1px solid #FF4346 ; z-index: 99999;">弹出窗口 <a href="javascript:;" onclick="javascript:document.getElementById('pop').style.display='none';">关闭</a></p>
<script>
(function(){
setTimeout(function(){
var obj = document.getElementById("pop");
obj.style.display = "block";
},3000);
function time(){
})();
</script>
Use setInterval instead of setTimeout
Same as above, use a periodic timer, just don’t clear the timer
If you want to use setTimeout, you need to call yourself or use setInterval