HTML | <output> name Attribute

The HTML <output> name Attribute is used to specify a name for a <output> element.
It is used to reference the form-data after submitting the form or to reference the element in a JavaScript.

Syntax:

<Output name="text"> 

Attribute Values: It contains the value i.e name which specify the name for the <Output> element.



Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML Output name Attribute
    </title>
</head>
  
<body>
    <center>
        <h1 style="color=green">
          GeeksforGeeks
      </h1>
        <h2>HTML Output name Attribute</h2>
        <form oninput="sumresult.value = parseInt(A.value) 
                + parseInt(B.value) + parseInt(C.value)">
            
            <input type="number" 
                   name="A"
                   value="50" /> +
            
            <input type="range" 
                   name="B" 
                   value="0" /> +
            
            <input type="number" 
                   name="C" 
                   value="30" />
            <br> Result:
            <output name="sumresult"></output>
        </form>
    </center>
</body>
  
</html>

chevron_right


Output:

Supported Browsers:

  • Google Chrome 10.0
  • Firefox 4.0
  • Edge 13.0
  • Opera 11.0
  • Apple Safari 5.1


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.