Objeto de cuerpo HTML DOM
Objeto de cuerpo
El objeto Body representa un elemento HTML <body>.
Acceder a un objeto del cuerpo
Puede acceder a un elemento <body> usando getElementsByTagName():
Ejemplo
var x = document.getElementsByTagName("BODY")[0];
Sugerencia: también puede acceder a un elemento <body> mediante la propiedad document.body .
Crear un objeto de cuerpo
Puede crear un elemento <body> utilizando el método document.createElement():
var x = document.createElement("BODY");
Propiedades del objeto del cuerpo
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 |
Propiedades y eventos estándar
El objeto Body también admite las propiedades y eventos estándar .
páginas relacionadas
Referencia HTML: etiqueta HTML <body>