HTMLOutputElement
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2016.
The HTMLOutputElement interface provides properties and methods (beyond those inherited from HTMLElement) for manipulating the layout and presentation of <output> elements.
Constructor
HTMLOutputElement()-
Creates a new
HTMLOutputElementobject.
Instance properties
This interface also inherits properties from its parent, HTMLElement.
HTMLOutputElement.defaultValue-
A string representing the default value of the element, initially the empty string.
HTMLOutputElement.formRead only-
An
HTMLFormElementindicating the form associated with the control, reflecting theformHTML attribute if it is defined. HTMLOutputElement.htmlForRead only-
A
DOMTokenListreflecting theforHTML attribute, containing a list of IDs of other elements in the same document that contribute to (or otherwise affect) the calculatedvalue. HTMLOutputElement.labelsRead onlyHTMLOutputElement.name-
A string reflecting the
nameHTML attribute, containing the name for the control that is submitted with form data. HTMLOutputElement.typeRead only-
The string
"output". HTMLOutputElement.validationMessageRead only-
A string representing a localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (
willValidateisfalse), or it satisfies its constraints. HTMLOutputElement.validityRead only-
A
ValidityStaterepresenting the validity states that this element is in. HTMLOutputElement.value-
A string representing the value of the contents of the elements. Behaves like the
Node.textContentproperty. HTMLOutputElement.willValidateRead only-
Returns a boolean value that indicates whether the element is a candidate for constraint validation. Always
falseforHTMLOutputElementobjects.
Instance methods
This interface also inherits methods from its parent, HTMLElement.
HTMLOutputElement.checkValidity()-
Checks the validity of the element and returns a boolean value holding the check result.
HTMLOutputElement.reportValidity()