Objeto de salida HTML DOM
Objeto de salida
El objeto Output representa un elemento HTML <output>.
Nota: El elemento <output> no es compatible con Internet Explorer/Edge.
Acceder a un objeto de salida
Puede acceder a un elemento <output> usando getElementById():
Ejemplo
var x = document.getElementById("myOutput");
Sugerencia: también puede acceder a un elemento <output> buscando en la colección de elementos de un formulario.
Crear un objeto de salida
Puede crear un elemento <output> utilizando el método document.createElement():
Ejemplo
var x = document.createElement("OUTPUT");
Propiedades del objeto de salida
Property | Description |
---|---|
defaultValue | Sets or returns the default value of an <output> element |
form | Returns a reference to the form that contains the <output> element |
htmlFor | Returns the value of the for attribute of an <output> element |
labels | Returns a list of <label> elements associated with the <output> element |
name | Sets or returns the value of the name attribute of an <output> element |
type | Returns which type of HTML element the Output object represents |
value | Sets or returns the value of an <output> element |
Propiedades y eventos estándar
El objeto de salida también admite las propiedades y los eventos estándar .
páginas relacionadas
Referencia HTML: etiqueta HTML <salida>