I have one html page "form1.html" which has an animated image. I want to load another page "form2.html" after 5 seconds. How do I do this?
To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after. Through this, you can automatically redirect your visitors to a new homepage.
To redirect a webpage after 5 seconds, use the setInterval() method to set the time interval. Add the webpage in window.
To redirect one HTML page to another page, you need to add a <meta> tag inside the <head> section of the old HTML page. The <head> section of an HTML document contains metadata that is useful for the browser, but invisible to users viewing the page.
<script> setTimeout(function(){ window.location.href = 'form2.html'; }, 5000); </script>
And for home page add only '/'
<script> setTimeout(function(){ window.location.href = '/'; }, 5000); </script>
<meta http-equiv="refresh" content="5;URL='form2.html'">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With