<output> tag represents the result of a calculation performed by an application or result of a user action.
<p>This form multiplies two values together:</p>
<form onsubmit="return false" oninput="o.value = a.valueAsNumber * b.valueAsNumber">
<input id=a name=a type=number step=any> *
<input id=b name=b type=number step=any> =
<output name=o for="a b"></output>
- Both the opening and closing tag are required.
<output> element supports the Global Attributes, along with the following:
forattribute specifies the variables to be used in calculating the results of the calculation. The
forattribute should consist of space-separated tokens that each reference the
idattribute of an element in the same document.
formattribute specifies the form ID to which the object belongs to. The form ID must be an ID of an element in the same document.
nameattribute specifies the name of the form control to use for form submission.
- Browsers will consider this element as an
aria-liveregion. Assistive technology will announce the results without requiring focus is swapped away from the controls producing the result.