Easy Tutorial
❮ Prop Text Size Prop Radio Defaultchecked ❯

Meta content Attribute


Definition and Usage

The content attribute sets or returns the value of the content attribute of a meta element.

The content attribute specifies the content of the meta information.

Note: The values available for this attribute depend on the values of the name and httpEquiv attributes.

Syntax

Set the content attribute:

Return the content attribute:


Browser Support

All major browsers support the content attribute.


Example

Display all meta attribute content values:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<meta name="keywords" content="HTML, DHTML, CSS, XHTML, JavaScript">
<meta name="description" content="Free Web tutorials">
<meta name="author" content="Hege Refsnes">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script>
function displayResult(){
    var x=document.getElementsByTagName("meta");
    var txt="";
    for (var i=0;i&lt;x.length;i++){
        txt=txt + "Content of "+(i+1)+". meta tag: "+x[i].content+"<br>";
    }
    document.getElementById("result").innerHTML=txt;
}
</script>
</head>
<body>

<button type="button" onclick="displayResult()">Display Meta Content</button>

<p id="result"></p>

</body>
</html>

❮ Prop Text Size Prop Radio Defaultchecked ❯