How To Redirect Page After Some Time In Javascript | Visual Studio Code

0


For current page

<html>
<head>
 <title></title>
</head>
<body>



<script>
 var timer= setTimeout(function() {
  window.location='http://google.com'
 },3000);


</script>
</body>
</html>


For open in new tab 



<html>
<head>
 <title></title>
</head>
<body>



<script>
 var timer= setTimeout(function() {
  window.open('http://google.com');
 },3000);


</script>
</body>
</html>

Post a Comment

 
Top