HTML DOM Output Object

Output Object

The Output object represents the HTML <output> element.

Note:Internet Explorer / Edge does not support the <output> element.

Access Output Object

You can use getElementById() to access the <output> element:

var x = document.getElementById("myOutput");

Try It Yourself

Tip:You can also access the <output> element by searching the element collection of the form.

Create Output Object

You can use the document.createElement() method to create an <output> element:

var x = document.createElement("OUTPUT");

Try It Yourself

Output Object Properties

Attributes Description
defaultValue Set or return the default value of the <output> element.
form Return a reference to the form containing the <output> element.
htmlFor Return the value of the for attribute of the <output> element.
labels Return the list of <label> elements associated with the <output> element.
name Set or return the value of the name attribute of the <output> element.
type Return the type of HTML element represented by the Output object.
value Set or return the value of the <output> element.

Standard Attributes and Events

Output Object Supports StandardsAttributesAndEvents.

Related Pages

HTML Reference Manual:HTML <output> Tag