+ 3

How to display a web page after few seconds of first webpage automatically

I mean to say suppose a web page Hello world displays some text.After 5 seconds it must go to another web page.How can that be achievable.

13th May 2020, 3:39 PM
Rajib Lochan Nandi
Rajib Lochan Nandi - avatar
1 Resposta
+ 2
The solution for example as follows: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width" /> <title>Redirection</title> <link rel="stylesheet" href="style.css" /> <script> function delay() {window.location = "http://www.sololearn.com";} </script> </head> <body onLoad = "setTimeout('delay()', 5000)"> <h1>You will be redirected in 5 second</h1> <div id="test"></div> <script src="script.js"></script> </body> </html>
13th May 2020, 5:13 PM
JaScript
JaScript - avatar