English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
name 属性规定 <output> 元素的名称。name属性用于在表单数据提交后引用它,或引用JavaScript中的元素。
执行计算并在 <output> 元素中显示结果:
<!DOCTYPE html> <html> <head> <title>HTML:<output> name 属性 - 基础教程网(oldtoolbag.com)</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> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
Firefox, Opera, Chrome, and Safari browsers all support the name attribute.
Note:Internet Explorer browser does not support the <output> tag.
The name attribute specifies the name of the <output> element.
The name attribute is used to refer to it after the form data is submitted, or to refer to elements in JavaScript.
The <output> tag is an HTML5 new tag in
<output name="name">
Value | Description |
---|---|
name | Specify the name of the <output> element. |