Meta httpEquiv Property - Change the value of the http-equiv and content attributes. - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meta


The following example will refresh the document every 30 seconds:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<meta http-equiv="content-type" content="text/html">

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {/*  w  ww  .  j  a  va2s.  com*/
    document.getElementsByTagName("META")[0].httpEquiv = "refresh";
    document.getElementsByTagName("META")[0].content = "30";
    document.getElementById("demo").innerHTML = "The document will refresh every 30 seconds.";


Related Tutorials