automatically-refresh-html-page-or-div

There are several ways to refresh a complete HTML page after specific time interval, and same is the case with any specific Div or Span or any HTML element on a page, that we can refresh any specific part/element of HTML page without reloading the complete page.

First let’s take a look at refreshing HTML page after specific time interval, this can be achieved using either JavaScript or by meta tags.

A) Using Javascript:

You can use either of the following scripts to refresh after every 5 secounds, say:

Code I:

[crayon-5bee0a3219777851268594/]

OR

Code II:

[crayon-5bee0a321977c239647117/]

B) Refresh page using Meta tags

Its very easy, you just have to put a meta tag in head tag as follows:

[crayon-5bee0a321977e673741525/]

Refresh Div/Span on HTML page after specific time:

In this part we will use JQuery to perform the task, as its provides few of the best options that can help us.
Suppose you have a div with ID as result similar to following:

[crayon-5bee0a3219780065389064/]

Then JQuery code will be as follows:

[crayon-5bee0a3219781393809140/]

Similarly you can use $.ajax() or $.post() etc instead of load() function and put the response in a div or a span.

— Automatically Refresh HTML page or div after specific time Interval —