English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML 参考手册

HTML 标签大全

HTML output name 属性

name 属性规定 <output> 元素的名称。name属性用于在表单数据提交后引用它,或引用JavaScript中的元素。

 HTML <output> Tag

在线示例

执行计算并在 <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 ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Firefox, Opera, Chrome, and Safari browsers all support the name attribute.

Note:Internet Explorer browser does not support the <output> tag.

Definition and Usage

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.

HTML 4.01 and HTML5differences between

The <output> tag is an HTML5 new tag in

Syntax

<output name="name">

Attribute Value

ValueDescription
nameSpecify the name of the <output> element.
 HTML <output> Tag