In this section, you will see the use and implementation of <output> tag of HTML5.
In this section, you will see the use and implementation of <output> tag of HTML5.In this section, we will introduce you to about the <output> tag. The output tag is used for displaying result of calculation on browser. The <output> tag is not present in HTML5. It has both start and end tag.
Attribute of option:Attributes | Value | Description |
name | string | Specify name of output element |
form | id | Related form name. |
for | id | Id of one or more related field |
<output name=""> Text </output> |
<!doctype html > <html ><head> <title>Document title.</title> <script type="text/javascript"> function multi() { a=parseInt(prompt("Enter first number.",0)); b=parseInt(prompt("Enter first number.",0)); document.forms["form"]["result"].value=a*b; } </script></head> <body onload="multi()"> <h1>output tag Example.</h1> <p><b>Implementation of <output > in HTML5.</b></p> <form action="roseindia.html" method="get" name="form"> <label>Multiplication of two number:</label> <output name="result"> </output> </form></body> </html> |
The <output> tag is available in both HTML5. It is not present in HTML4.01.