Vlastnost meta obsahu
Příklad
Vrátí hodnotu atributu content všech meta prvků:
var x = document.getElementsByTagName("META");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "Content of "+(i+1)+". meta tag: "+x[i].content+"<br>";
}
Definice a použití
Vlastnost content nastavuje nebo vrací hodnotu atributu content prvku meta.
Atribut content určuje obsah meta informací.
Poznámka: Dostupné hodnoty této vlastnosti závisí na hodnotě názvu a vlastnostech httpEquiv .
Podpora prohlížeče
Property | |||||
---|---|---|---|---|---|
content | Yes | Yes | Yes | Yes | Yes |
Syntax
Vraťte vlastnost content:
metaObject.content
Nastavte vlastnost obsahu:
metaObject.content = text
Value | Description |
---|---|
text | The content of the meta information |
Návratová hodnota
Type | Description |
---|---|
String | The value of the content attribute of the meta element |
Další příklady
Příklad
Změňte hodnotu atributu content třetího meta prvku (index 2) v hlavičce:
document.getElementsByTagName("META")[2].content = "Bill Mosley";
❮ Meta objekt