Đối tượng meta DOM HTML
Đối tượng Meta
Đối tượng Meta đại diện cho một phần tử HTML <meta>.
Truy cập một đối tượng Meta
Bạn có thể truy cập phần tử <meta> bằng cách sử dụng getElementsByTagName ():
var x = document.getElementsByTagName("META")[0];
Tạo một đối tượng Meta
Bạn có thể tạo một phần tử <meta> bằng cách sử dụng phương thức document.createElement ():
Thí dụ
var x = document.createElement("META");
Thuộc tính đối tượng meta
Property | Description |
---|---|
content | Sets or returns the value of the content attribute of a meta element |
httpEquiv | Sets or returns an HTTP header for the information in the content attribute |
name | Sets or returns a name for the information in the content attribute |
scheme | Not supported in HTML5. Sets or returns how the value of the content attribute should be interpreted |
Thuộc tính và sự kiện tiêu chuẩn
Đối tượng Meta cũng hỗ trợ các thuộc tính và sự kiện tiêu chuẩn .
Các trang liên quan
Tham chiếu HTML: Thẻ <meta> HTML