VOOZH about

URL: https://www.geeksforgeeks.org/html/html-output-tag/

⇱ HTML <output> Tag - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <output> Tag

Last Updated : 23 May, 2026

The <output> tag in HTML is used to display the result of a calculation or user action. It is commonly used in forms to show dynamic output generated by scripts.

  • Displays the result of calculations or user interactions.
  • Commonly used with JavaScript and form elements.
  • Helps show dynamic and real-time output on webpages.

It also supports the Global Attributes and Event Attributes in HTML. The content within the <output> tag can be manipulated dynamically through JavaScript.

Syntax:

<output> Results... </output>

Attributes

  • for: for specifies the relationship between the calculation and the result element.
  • form:form defines one or more forms to which the <output> element belongs.
  • name:name specifies the name of the <output> element.

Example 1: Implementation of output tag with an example.

Example 2: <output> tag is used with for and form attribute. 

Comment
Article Tags: