메타 이름 속성
예시
모든 메타 요소의 콘텐츠 속성 값을 반환합니다.
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>";
}
정의 및 사용
name 속성은 content 속성의 정보에 대한 이름을 설정하거나 반환합니다.
name 속성의 값은 content 속성의 값에 따라 다릅니다.
WHATWG Wiki MetaExtensions 페이지에 정의된 확장 목록도 있습니다. - 누구나 언제든지 페이지를 자유롭게 편집하여 새 유형을 추가할 수 있습니다. 공식적으로 받아들여지는 것은 없지만 앞으로는 그럴 수 있습니다. 자세한 내용은 WHATWG Wiki MetaExtensions 페이지 를 참조하십시오 .
참고: http-equiv 속성이 설정된 경우 name 속성은 설정되지 않아야 합니다.
브라우저 지원
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
통사론
name 속성을 반환합니다.
metaObject.name
이름 속성을 설정합니다.
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"> |
반환 값
Type | Description |
---|---|
String | A name for the information in the content attribute |
❮ 메타 객체