Output htmlFor Attribute

Definition and Usage

htmlFor returns <output> element The HTML <output> for Attribute Value.

The for attribute specifies the relationship between the calculated result and the element used in the calculation.

Note:This property is read-only.

See also:

HTML Reference Manual:HTML <output> for Attribute

HTML Reference Manual:HTML <output> Tag

Example

Obtain the relationship between the calculated result and the element used in the calculation:

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

Try It Yourself

Syntax

outputObject.htmlFor

Technical Details

Return Value: Reference to the relationship between the calculated result and the element used in the calculation.

Browser Support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
10.0 Not Supported 4.0 5.1 11.0