HTML DOM Meta Obheto

Meta object

The Meta object represents the HTML <meta> element.

Access Meta object

You can use getElementsByTagName() to access the <meta> element:

var x = document.getElementsByTagName("META")[0];

Try it yourself

Create Meta object

You can use the document.createElement() method to create a <meta> element:

var x = document.createElement("META");

Try it yourself

Meta object attributes

属性 Description
content Set or return the value of the content attribute of the meta element.
httpEquiv Set or return the HTTP header of the content attribute.
name Set or return the name of the information in the content attribute.
scheme

HTML5 中不支持。

设置或返回 content 属性值的解释方式。

标准属性和事件

Meta 对象同时支持标准属性事件

相关页面

HTML 参考手册:HTML <meta> 标签