Objet de corps HTML DOM
Objet corps
L'objet Body représente un élément HTML <body>.
Accéder à un objet corps
Vous pouvez accéder à un élément <body> en utilisant getElementsByTagName() :
Exemple
var x = document.getElementsByTagName("BODY")[0];
Conseil : Vous pouvez également accéder à un élément <body> en utilisant la propriété document.body .
Créer un objet corps
Vous pouvez créer un élément <body> en utilisant la méthode document.createElement() :
var x = document.createElement("BODY");
Propriétés de l'objet corps
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 |
Propriétés et événements standard
L'objet Body prend également en charge les propriétés et événements standard .
Pages connexes
Référence HTML : balise HTML <body>