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

Javascript examples for DOM HTML Element:Meta

Introduction

The following example will refresh the document every 30 seconds:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

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

<script>
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.";
}
</script>

</body>
</html>

Related Tutorials