Propriedade do metanome
Exemplo
Retorna o valor do atributo content de todos os meta elementos:
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>";
}
Definição e uso
A propriedade name define ou retorna um nome para as informações no atributo content.
O valor do atributo name depende do valor do atributo content.
Há também uma lista estendida definida na página de MetaExtensões do Wiki do WHATWG - Qualquer pessoa é livre para editar a página a qualquer momento para adicionar um novo tipo. Nenhum é formalmente aceito, mas pode ser no futuro. Para obter mais informações, visite a página WHATWG Wiki MetaExtensions .
Nota: Se o atributo http-equiv for configurado, o atributo name não deverá ser configurado.
Suporte ao navegador
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
Sintaxe
Retorne a propriedade do nome:
metaObject.name
Defina a propriedade do nome:
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"> |
Valor de retorno
Type | Description |
---|---|
String | A name for the information in the content attribute |
❮ Metaobjeto