VOOZH about

URL: https://www.geeksforgeeks.org/html/html-output-for-attribute/

⇱ HTML <output> for Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <output> for Attribute

Last Updated : 11 Jul, 2025

HTML <output> for Attribute specifies the relationship between the output element and the input elements it represents or is associated with. It typically contains the ID of the related input element.

Syntax:

<output for="element_id">

Attribute Values:

Name

Description

element_id

The "for" attribute in the <output> tag specifies the IDs of elements related to the calculation result.

HTML <output> for Attribute Examples

Example: In this example, we are using the <output> tags for attributes to associate input elements A, B, and C with a calculated result displayed within the form.

Output: 

👁 outputForAttribute
HTML output for Attribute



Supported Browsers: The browser supported by HTML <output>for Attribute are listed below: 

Comment
Article Tags: