Javascript examples for DOM HTML Element:Meta
The following example will refresh the document every 30 seconds:
<!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>