Hurry! Try our new Interactive Courses for FREE. 🥳   🚀
  Signup/Sign In

HTML Output Tag

In HTML, the <output> tag is used as a Container Element.

  • This container element is used inside a site or app to inject the result of any calculation.

  • This tag is newly introduced in HTML5.

  • Also, this is an inline element.

HTML <output> Tag Syntax and Usage

The <output> tag requires both opening (start) tag and closing(end) tag.

<output>
...content here
</output>

HTML <output> Tag Attributes

The <output> tag supports both global and event attributes and some of the common attributes are given below:

1. Name

This attribute is used to indicate the name for the output element.

2. Form

This attribute is used to specify the form to which this output belongs to.

3. For

The for attribute is used when you want to specify the relationship between the result of the calculation and elements used for calculation

HTML <output> Tag Basic Example

Below we have a basic example for the <output> tag:

Default CSS Settings for HTML <output> Tag

Most of the browsers use default CSS settings for <output> tag and it is given below:

output {
  display: inline;
}

Browser Support for HTML <output> Tag

Following browsers support this attribute:

  • Firefox 4+

  • Google Chrome 10+

  • Safari 5.1+

  • Opera 11+