当前位置: 移动技术网 > IT编程>开发语言>JavaScript > 使用js实现倒计时跳转功能(代码教程)

使用js实现倒计时跳转功能(代码教程)

2019年03月22日  | 移动技术网IT编程  | 我要评论

使用js实现倒计时跳转功能(代码教程)

<p style="text-align: center"> 
<h1 style="">{{$msg}}成功,倒计时<strong id="tid">3</strong>秒跳转</h1> 
</p> 
<script> 
window.onload = function () { 
var tid = document.getelementbyid('tid'); 
setinterval (function () { 
var middle = tid.innerhtml 
tid.innerhtml = middle - 1 ; 
if (tid.innerhtml == 0) { 
location.href = '倒计时后跳转路径' 
} 
},1000); 
} 
</script>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网