THE BEST WEB DEVELOPER SITE

HTML DOM Output Object


Output Object HTML5

The Output Object is new in HTML5.

The Output object represents an HTML <output> element.

Note: The <output> element is not supported in Internet Explorer / Edge.

Access an Output Object

You can access an <output> element by using getElementById():

Example

var x = document.getElementById("myOutput");
Try it Yourself »

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

Create an Output Object

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

Example

var x = document.createElement("OUTPUT");
Try it Yourself »

Output Object Properties

Property Description
defaultValue Sets or returns the default value of an <output> element
form Returns a reference to the form that contains the <output> element
htmlFor Returns the value of the for attribute of an <output> element
labels Returns a list of <label> elements associated with the <output> element
name Sets or returns the value of the name attribute of an <output> element
type Returns which type of HTML element the Output object represents
value Sets or returns the value of an <output> element

Standard Properties and Events

The Output object also supports the standard properties and events.


Related Pages

HTML reference: HTML <output> tag