Skip to main content
ouptut element | output object

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Represents the result of a calculation or user action.

HTML5 A vocabulary and associated APIs for HTML and XHTML

 

DOM Information

Inheritance Hierarchy

  Node
   Element
    HTMLElement
     output

Members

The output object has these types of members:

Methods

The output object has these methods.

MethodDescription
checkValidity

Returns whether a form will validate when it is submitted, without having to submit it.

 

Properties

The output object has these properties.

PropertyAccess typeDescription

defaultValue

Sets or retrieves the initial contents of the object.

for

Specifies the IDs of the elements from which the output was calculated.

name

Sets or retrieves the name of the object.

type

Specifies when the element type is the output element.

validationMessage

Read-only

Returns the error message that would be displayed if the user submits the form, or an empty string if no error message.

validity

Read-only

Returns a ValidityState object that represents the validity states of an element.

value

Gets or sets the value of the object.

 

Standards information

Examples


<form oninput="result.value=parseInt(valOne.value)+parseInt(valeTwo.value)">
    <input type="number" id="valOne" value="5" /> +
    <input type="number" id="valTwo" value="20" /> =
    <output name="result" for="valOne valTwo"></output>
</form>

See also

Node
form