HTML DOM Meta content property
Definition and Usage
content property sets or returns meta element content attribute values.
content attribute specifies the content meta information.
Note: This property is available depends on the value of name and httpEquiv property.
grammar
Setting content properties:
linkObject.content="text"
Returns content properties:
linkObject.content
Browser Support
All major browsers support content property
Examples
Examples
Show all meta content attribute values:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ 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 <x.length; i ++) {
txt = txt + "Content of" + (i + 1) +: + x [i] .content + "<br>"; "meta tag."
}
document.getElementById ( "result") innerHTML = txt.;
}
</ Script>
</ Head>
<Body>
<Button type = "button" onclick = "displayResult ()"> Display Meta content </ button>
<P id = "result"> </ p>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ 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 <x.length; i ++) {
txt = txt + "Content of" + (i + 1) +: + x [i] .content + "<br>"; "meta tag."
}
document.getElementById ( "result") innerHTML = txt.;
}
</ Script>
</ Head>
<Body>
<Button type = "button" onclick = "displayResult ()"> Display Meta content </ button>
<P id = "result"> </ p>
</ Body>
</ Html>
try it"
Meta Object