Obiekt zawartości HTML DOM Meta
Definicja i Wykorzystanie
Zawartość zestawów własności lub zwraca meta elementem zawartości wartości atrybutów.
atrybut content określa treść informacji meta.
Uwaga: Ta właściwość jest dostępna zależy od wartości nazwy i httpEquiv nieruchomości.
gramatyka
Ustawianie właściwości treści:
linkObject.content="text"
Zwraca właściwości zawartości:
linkObject.content
Pomoc Browser
Wszystkie główne przeglądarki obsługują właściwość treści
Przykłady
Przykłady
Pokaż wszystkie meta wartości atrybutów treści:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Ten poradnik (w3big.com) </ title>
<Meta name = "keywords" content = "HTML, DHTML, CSS, XHTML, JavaScript">
<Meta name = "description" content = "Darmowe tutoriale z sieci">
<Meta name = "author" content = "Hege Refsnes">
<Meta http-equiv = "Content-Type" content = "text / html; charset = utf-8">
<Script>
Funkcja displayResult () {
var x = document.getElementsByTagName ( "meta");
var txt = "";
for (var i = 0; i <x.length; i ++) {
txt = txt + "Treść" + (i + 1) +: + x [i] .content + "Łódź"; "tag".
}
document.getElementById ( "Wynik") innerHTML = txt .;
}
</ Script>
</ Head>
<Body>
<Type = "button" button onclick = "displayResult ()"> Wyświetlanie zawartości Meta </ button>
<P id = "result"> </ p>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Ten poradnik (w3big.com) </ title>
<Meta name = "keywords" content = "HTML, DHTML, CSS, XHTML, JavaScript">
<Meta name = "description" content = "Darmowe tutoriale z sieci">
<Meta name = "author" content = "Hege Refsnes">
<Meta http-equiv = "Content-Type" content = "text / html; charset = utf-8">
<Script>
Funkcja displayResult () {
var x = document.getElementsByTagName ( "meta");
var txt = "";
for (var i = 0; i <x.length; i ++) {
txt = txt + "Treść" + (i + 1) +: + x [i] .content + "Łódź"; "tag".
}
document.getElementById ( "Wynik") innerHTML = txt .;
}
</ Script>
</ Head>
<Body>
<Type = "button" button onclick = "displayResult ()"> Wyświetlanie zawartości Meta </ button>
<P id = "result"> </ p>
</ Body>
</ Html>
Spróbuj »
meta Object