Name

Output — an HTML form <output> element

Inherits from

Node, Element, FormControl

Synopsis

The Output object represents an HTML form <output> element. In browsers that support them, Output objects implement most of the properties of FormControl.

Properties

string defaultValue

This property is the initial value of the Output element’s textContent (see Node). When the form is reset, its value is restored to this value. If this property is set and the Output element is currently displaying its previous defaultValue, the new default value will be displayed. Otherwise, the currently displayed value will not be changed.

readonly DOMSettableTokenList htmlFor

The HTML for attribute of an <output> element is a space-separated list of the IDs of elements whose values contributed to the computed content displayed by the <output> element. for is a reserved word in JavaScript, so this corresponding JavaScript property is named htmlFor instead. You can get and set this property as if it was an ordinary string value, or you can use the methods of DOMTokenList to query and set individual element IDs from the list.

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.