HTML <output> name 属性
定义和用法
name
The attribute specifies the name of the <output> element.
name
The attribute is used to refer to data after the form data is submitted, or to refer to elements in JavaScript.
Example
Perform the calculation and display the result in the <output> element:
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)"> <input type="range" id="a" value="50"> +<input type="number" id="b" value="25"> =<output name="x" for="a b"></output> </form>
Syntax
<output name="name">
Attribute value
Value | Description |
---|---|
name | Specifies the name of the <output> element. |
Browser support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
10.0 | 13.0 | 4.0 | 7.0 | 11.5 |