English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The form attribute specifies one or more forms that the <output> element belongs to.
An <output> element located outside the form (but still part of the form):
<!DOCTYPE html> <html> <head> <title>HTML:<output> form attribute - 基础教程网(oldtoolbag.com)</title> </head> <body> <form action="action_page.php" id="numform" oninput="x.value=parseInt(a.value)+parseInt(b.value)>0 <input type="range" id="a" name="a" value="30">100 +<input type="number" id="b" name="b" value="30"> <br><br> <input type="submit"> </form> <p>The output element below is outside the form, but is still part of the form.</p> <output form="numform" name="x" for="a b"></output> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
Almost all mainstream browsers do not support the form attribute.
The form attribute specifies one or more forms that the <output> element belongs to.
The <output> tag is an HTML5 of the new tag.
<output form="form_id">
Value | Description |
---|---|
form_id | Specifies the form element that the <output> element belongs to. The value of this attribute must be the id attribute of a <form> element in the same document. |