How to specify a name for the output element in HTML? Last Updated : 16 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The name attribute specifies the name of an <output> element. It is used to reference form data after it has been submitted, or to reference the element in JavaScript. The <output> tag is used to represent the result of a calculation. The HTML <for> type attribute is used because it specifies the relationship between the result of the calculation and the elements used in the calculation. form is used because it specifies which form the output element it belongs to. name is used because it specifies a name for the output element. Syntax: <output name="name"> Example: In this example, we will specify a name for the output element. HTML <!DOCTYPE html> <html> <body> <h1>The output element</h1> <form oninput= "k.value=parseInt(x.value)+parseInt(y.value)"> <input type="range" id="x" value="20"> + <input type="number" id="y" value="20"> = <output name="k" for="x y"></output> </form> </body> </html> Output: Comment More infoAdvertise with us Next Article How to specify a name for the output element in HTML? S subham348 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-Questions Similar Reads How to specify the name of an input element? To add the name of an input element, we use the HTML <input> name attribute. The HTML <input> name attribute is used to specify a name for an <input> element. It is used to reference the form data after submitting the form or to reference the element in JavaScript. Syntax:<input 2 min read How to specify a name for the fieldset using HTML ? The <fieldset> tag in HTML5 is used to make a group of related elements in the form and it creates the box over the elements. The <fieldset> tag is new in HTML5. The HTML <fieldset> name attribute is used to specify the name for the fieldset element. It is used to reference the for 1 min read How to specify name of an iframe element using HTML ? The iframe in HTML stands for Inline Frame. The "iframe" tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders. An inline frame is used to embed another document within the current HTML document. The HTML iframe na 1 min read How to set the name for the object in HTML5? <object> element in HTML5 is used to link any external files and resources in the form of any image or any nested linked webpages or content or any plugin that can do the same work.Syntax:<object name="name"></object>Elementary uses of <object/ element:Initially <object> i 2 min read How to set a name for the metadata in HTML5 ? The metadata means the information about data. The <meta> tag in HTML provides information about HTML document or in simple words, it provides important information about a document. These tags are basically used to add name/value pairs to describe properties of HTML documents, such as expiry 1 min read Like