OutputElement
The HTMLOutputElement
interface provides properties and methods (beyond those inherited from HTMLElement
) for manipulating the layout and presentation of output
elements.
Documentation HTMLOutputElement by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
htmlFor: DOMTokenList
A DOMTokenList
reflecting the for
HTML attribute, containing a list of IDs of other elements in the same document that contribute to (or otherwise affect) the calculated value
.
form: FormElement
An HTMLFormElement
indicating the form associated with the control, reflecting the form
HTML attribute if it is defined.
name: String
A DOMString
reflecting the name
HTML attribute, containing the name for the control that is submitted with form data.
type: String
The DOMString
"output"
.
defaultValue: String
A DOMString
representing the default value of the element, initially the empty string.
value: String
A DOMString
representing the value of the contents of the elements. Behaves like the Node.textContent
property.
willValidate: Bool
A Boolean
indicating whether the element is a candidate for constraint validation.
validity: ValidityState
A ValidityState
representing the validity states that this element is in.
validationMessage: String
A DOMString
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 (willValidate
is false
), or it satisfies its constraints.
labels: NodeList
A NodeList
of label
elements associated with the element.
checkValidity(): Bool
Checks the validity of the element and returns a Boolean
holding the check result.
Returns |
---|
Bool |
reportValidity(): Bool
Triggers an invalid
event and evaluates its result. if the result is true
, then the problems with the constraints of this element are reported to the user. 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.
Returns |
---|
Bool |
Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
Name | Type |
---|---|
error |
String |