HTML DOM Meta name attribute
Definition and Usage
name property sets or returns the name of the attribute information content.
name attribute value depends on the content attribute values.
Name property value can be predefined or user-defined. / P>
grammar
Setting name attribute:
linkObject.name="name"
Returns the name attribute:
linkObject.name
Predefinednamevalue:
值 | 描述 |
---|---|
abstract | 定义了一个二级描述 |
author | 定义文档的作者。 实例: <meta name="author" content="Hege Refsnes"> |
classification | 归类站点到正确类别 |
copyright | 定义文档的版权信息。 实例: <meta name="copyright" content="2011© W3Cschool.cc"> |
description | 索引擎可以使用这个描述作为搜索结果。 实例: <meta name="description" content="Free web tutorials"> |
distribution | 规定文件是否可用于Web或Intranet。
实例: |
doc-class | 指定文档完成的状态 |
doc-rights | 文档的版权声明 |
doc-type | 指定文档的类型 |
DownloadOptions | 控制下载对话框按钮的显示。noopen - 隐藏打开按钮,nosave - 隐藏保存按钮。 |
expires | 设置网页过期时间 实例: <meta name="expires" content="Fri, 10 Jun 2011 12:00:00 GMT"> |
generator | 指定文档生成的工具名称 |
googlebot | 设置 Google 搜索隐藏的收入规则:
实例: |
keywords | 网页关键字 提示:一般需要指定该标签,有利于搜索引擎的优化。 实例: <meta http-equiv="keywords" content="HTML, HTML DOM, JavaScript"> |
MSSmartTagsPreventParsing | 防止微软页面编辑软件在页面上自动添加标签、链接等。 |
name | 指定文档的名称 |
owner | 定义网页的所有者 |
progid | 定义程序 id 用于生成文档。 |
rating | 定义内容分级,如:14 years(14岁以上),general(普通人),mature(成年人),restricted(限制级),safe for kids(孩童)。 |
refresh | 定义文档在规定的时间内容刷新或跳转到新的 URL 上。 实例: <meta name="refresh" content="10"> <meta name="refresh" content="10;URL=http://www.w3big.com"> |
reply-to | 定义网页开发者的邮件地址 |
resource-type | 定义 web 资源类型 |
revisit-after | 定义搜索引擎爬取网页的时间频率 |
robots | 设定搜索引擎爬取网页的规则: 可以是以下属性,多个属性使用逗号隔开:
实例: |
Template | 内容属性可以指定用于编译文档的模板位置 |
others | 你可以定义自己的名字 |
Browser Support
All major browsers support attribute name
Examples
Examples
Display <meta> tag name attribute values:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Meta name = "keywords" content = "HTML, HTML DOM, JavaScript">
<Script>
function displayResult () {
var x = document.getElementsByTagName ( "meta") [0] .name;
alert (x);
}
</ Script>
</ Head>
<Body>
<Button type = "button" onclick = "displayResult ()"> Display meta name </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Meta name = "keywords" content = "HTML, HTML DOM, JavaScript">
<Script>
function displayResult () {
var x = document.getElementsByTagName ( "meta") [0] .name;
alert (x);
}
</ Script>
</ Head>
<Body>
<Button type = "button" onclick = "displayResult ()"> Display meta name </ button>
</ Body>
</ Html>
try it"
Meta Object