Open In App
Related Articles

HTML | <output> for Attribute

Improve Article
Save Article
Like Article

The HTML <output> for Attribute is used to specify  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. 


<!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 version 10 and above
  • Edge version 18 and above
  • Internet Explorer not supported
  • Firefox version 4 and above
  • Opera 11 and above
  • Safari 7 and above


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 06 Jul, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials