Output value attribute

Definition and usage

value Attribute setting or return The <output> element Value.

This value represents the result of the calculation.

See also:

HTML Reference Manual:HTML <output> Tag

Example

Example 1

Set the calculation result:

document.getElementById("myOutput").value = "150";

Try it yourself

Example 2

Get the calculation result:

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

Try it yourself

Syntax

Return the value attribute:

outputObject.value

Set value attribute:

outputObject.value = result

Attribute Value

Value Description
result Specifies the calculated result.

Technical Details

Return Value: A string value representing the calculated result.

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

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