clock  Mon - Sun 8.00 AM - 8.00 PM
mail  edu@teknowize.com
fb
instagram
play store
pinterest

How To Redirect To Another Page After Specified Time Using jQuery

  Sumit Dey Sarkar
  09 Sep 2022
  JQuery
Imperial Advance Hero Image

How To Redirect To Another Page After Specified Time Using jQuery

In this tutorial we will learn how to redirect to another page after specified time using jQuery.

Here we will use setTimeout to redirect to another page after specified time like 2 second, 5 second , 10 second, 15 second etc.

Let's see example - 

How to redirect to another page after specified time using jQuery

<!DOCTYPE html>
<html>
<head>
    <title>How To Redirect To Another Page After Specified Time Using jQuery</title>
    <script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
</head>
<body> 
   
<button class="redirectButton">Click me to Redirect after specified time</button>
     
<script>
    
    $(".redirectButton").click(function(){
        $(this).text('Redirecting soon....');
    
        var delay = 3500; 
        var url = 'https://www.teknowize.com/'
        setTimeout(function(){ window.location = url; }, delay);
    })
    
</script>
   
</body>
</html>