Объект тела HTML DOM
Объект тела
Объект Body представляет элемент HTML <body>.
Доступ к объекту тела
Вы можете получить доступ к элементу <body> с помощью getElementsByTagName():
Пример
var x = document.getElementsByTagName("BODY")[0];
Совет. Вы также можете получить доступ к элементу <body> с помощью свойства document.body .
Создайте объект тела
Вы можете создать элемент <body> с помощью метода document.createElement():
var x = document.createElement("BODY");
Свойства объекта тела
Property | Description |
---|---|
aLink | Not supported in HTML5. See CSS :active Selector instead.
Sets or returns the color of an active link in a document |
background | Not supported in HTML5. Use style.backgroundImage instead. Sets or returns the background image for a document |
bgColor | Not supported in HTML5. Use style.backgroundColor instead. Sets or returns the background color of a document |
link | Not supported in HTML5. See CSS :link Selector instead. Sets or returns the color of unvisited links in a document |
text | Not supported in HTML5. Use style.color instead. Sets or returns the color of the text in a document |
vLink | Not supported in HTML5. See CSS :visited Selector instead.
Sets or returns the color of visited links in a document |
Стандартные свойства и события
Объект Body также поддерживает стандартные свойства и события .
Связанные страницы
Справочник по HTML: HTML-тег <body>