Obiekt treści HTML DOM
Obiekt ciała
Obiekt Body reprezentuje element HTML <body>.
Uzyskaj dostęp do obiektu ciała
Możesz uzyskać dostęp do elementu <body> za pomocą getElementsByTagName():
Przykład
var x = document.getElementsByTagName("BODY")[0];
Wskazówka: możesz również uzyskać dostęp do elementu <body> za pomocą właściwości document.body .
Utwórz obiekt ciała
Możesz utworzyć element <body> za pomocą metody document.createElement():
var x = document.createElement("BODY");
Właściwości obiektu ciała
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 |
Standardowe właściwości i zdarzenia
Obiekt Body obsługuje również standardowe właściwości i zdarzenia .
Powiązane strony
Odniesienie HTML: tag HTML <body>