Javascript examples for DOM HTML Element:Meta
The Meta object represents an HTML <meta> element.
You can access a <meta> element by using getElementsByTagName():
<!DOCTYPE html> <html> <head> <meta name="description" content="tutorials"> </head>/*from w ww .j a va 2s .co m*/ <body> <button onclick="myFunction()">get the content of the meta information</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementsByTagName("META")[0].content; document.getElementById("demo").innerHTML = x; } </script> </body> </html>