files/en-us/web/api/htmloutputelement/index.md
{{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}}
This interface also inherits properties from its parent, {{domxref("HTMLElement")}}.
form HTML attribute if it is defined.for HTML attribute, containing a list of IDs of other elements in the same document that contribute to (or otherwise affect) the calculated value.name HTML attribute, containing the name for the control that is submitted with form data."output".willValidate is false), or it satisfies its constraints.false for HTMLOutputElement objects.This interface also inherits methods from its parent, {{domxref("HTMLElement")}}.
{{domxref("HTMLOutputElement.checkValidity()")}}
{{domxref("HTMLOutputElement.reportValidity()")}}
: This method reports the problems with the constraints on the element, if any, to the user. If there are problems, fires an {{domxref("HTMLInputElement/invalid_event", "invalid")}} event at the element, and returns false; if there are no problems, it returns true.
When the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform some other action that brings the element to the user's attention. User agents may report more than one constraint violation if this element suffers from multiple problems at once. If the element is not rendered, then the user agent may report the error for the running script instead of notifying the user.
{{domxref("HTMLOutputElement.setCustomValidity()")}}
This element behaves in one of two modes: default mode and value 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.
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}}
{{Compat}}