docs.rodeo

MDN Web Docs mirror

HTMLOutputElement

{{APIRef("HTML DOM")}} 

The HTMLOutputElement interface provides properties and methods (beyond those inherited from {{domxref("HTMLElement")}} ) for manipulating the layout and presentation of {{HTMLElement("output")}}  elements.

{{InheritanceDiagram}} 

Instance properties

This interface also inherits properties from its parent, {{domxref("HTMLElement")}} .

Instance methods

This interface also inherits methods from its parent, {{domxref("HTMLElement")}} .

Modes

This element behaves in one of two modes: default mode and value mode.

Default mode

Initially, the element is in default mode, and so the contents of the element represent both the value of the element and its default value.

If the element is in default mode when the descendants of the element are changed in any way, the defaultValue property is set to the value of the {{domxref("Node.textContent","textContent")}}  property.

Resetting the form puts the element into default mode, and sets the {{domxref("Node.textContent","textContent")}}  property to the value of the defaultValue property.

Value mode

The element goes into value mode when the contents of the value property are set. The value property otherwise behaves like the {{domxref("Node.textContent","textContent")}}  property. When the element is in value mode, the default value is accessible only through the defaultValue property.

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN