Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | <output> for Attribute

  • Last Updated : 17 Aug, 2021

The HTML <output> for Attribute is used to specify the the relationship between the result and the calculation.

<output for="element_id">

Attribute Values: It contains a value i.e element_id which specify the separated list of ids of one or more elements that specify the relationship between the result and the calculation.
Example: This Example that illustrates the use of for attribute in Output Element. 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.


<!DOCTYPE html>
        HTML | For Attribute
        body {
            text-align: center;
        h1 {
            color: green;
      HTML | <output>For Attribute
    <form oninput="sumresult.value = parseInt(A.value)
                + parseInt(B.value) + parseInt(C.value)">
        <input type="number"
               value="50" /> +
        <input type="range"
               value="0" /> +
        <input type="number"
               value="50" />
        <br /> Submit Result:
        <output name="sumresult"
                for="A B C">
        <input type="submit">


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

  • Google Chrome
  • Firefox
  • Opera
  • Safari
  • Microsoft Edge


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!