HTML Meta Refresh

22nd May 2008 - 1 minute read time

To get a webpage to refresh every few seconds you can use a meta tag with the attribute http-equiv and a value of refresh. The number of seconds to delay can be put into the content attribute. This meta tag (as will all meta tags) goes into the head section of the document.

Here is an example that refreshes the page every 2 seconds.

<meta http-equiv="refresh" content="2" />

It is also possible to make the browser refresh to another page by including the string:

url=url or filename

Within the content attribute. Here is an example that redirects the page to after a 5 second delay.

<meta http-equiv="refresh" content="5;url=" />


Add new comment

The content of this field is kept private and will not be shown publicly.