<output>
HTML <output> Tag
Instance
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文网(php.cn)</title> </head> <body> <form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0 <input type="range" id="a" value="50">100 +<input type="number" id="b" value="50"> =<output name="x" for="a b"></output> </form> <p><strong>注意:</strong> Internet Explorer 不支持 output 标签。</p> </body> </html>
Run Example»
Click the "Run Instance" button to view the online instance
Browser support
Note:Internet Explorer does not support the <output> tag.
Tag definition and usage instructions<output> The tag is displayed as the output of the calculation result (such as the output of the execution script).
Differences between HTML 4.01 and HTML5The<output> tag is a new tag in HTML 5.
Attributes
New: HTML5 new attributes.
Value | Description | |
---|---|---|
New | element_id | Describes the relationship between the elements used in the calculation and the calculation result.|
New | form_id | Define one or more forms to which the input fields belong.|
New | name | Define the unique name of the object (used when submitting the form) .
Event attributes<output> tag supports all HTML event attributes.