Get Meta Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meta


The Meta object represents an HTML <meta> element.

You can access a <meta> element by using getElementsByTagName():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<meta name="description" content="tutorials">
</head>/*from w  ww .j a  va 2s  .co  m*/

<button onclick="myFunction()">get the content of the meta information</button>

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

function myFunction() {
    var x = document.getElementsByTagName("META")[0].content;
    document.getElementById("demo").innerHTML = x;


Related Tutorials