Metanaam Eigenschap _
Voorbeeld
Retourneer de waarde van het content-attribuut van alle meta-elementen:
var x = document.getElementsByTagName("META");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "Name of "+(i+1)+". meta tag: "+x[i].name+"<br>";
}
Definitie en gebruik
Met de eigenschap name wordt een naam ingesteld of geretourneerd voor de informatie in het content-attribuut.
De waarde van het name-attribuut hangt af van de waarde van het content-attribuut.
Er is ook een uitgebreide lijst gedefinieerd in de WHATWG Wiki MetaExtensions-pagina - Iedereen is vrij om de pagina op elk moment te bewerken om een nieuw type toe te voegen. Geen enkele is formeel geaccepteerd, maar kan in de toekomst zijn. Ga voor meer informatie naar de WHATWG Wiki MetaExtensions-pagina .
Opmerking: als het kenmerk http-equiv is ingesteld, mag het kenmerk name niet worden ingesteld.
Browserondersteuning
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
Syntaxis
Retourneer de eigenschap name:
metaObject.name
Stel de eigenschap name in:
metaObject.name = "application-name|author|description|generator|keywords"
Value | Description |
---|---|
application-name | Specifies the name of the Web application that the page represents |
author | Specifies the name of the author of the document. Example: <meta name="author" content="Hege Refsnes"> |
description | Specifies a description of the page. Search engines can pick up this description to show with the results of searches. Example: <meta name="description" content="Free web tutorials"> |
generator | Specifies one of the software packages used to generate the document (not used on hand-authored pages) Example: <meta name="generator" content="FrontPage 4.0"> |
keywords | Specifies a comma-separated list of keywords - relevant to the page (Informs search engines what the page is about). Tip: Always specify keywords (needed by search engines to catalogize the page). Example: <meta name="keywords" content="HTML, meta tag, tag reference"> |
Winstwaarde
Type | Description |
---|---|
String | A name for the information in the content attribute |
❮Meta-object