output

<output>

HTML5中引入

HTML <output> 标签表示计算或用户操作的结果。

内容类别
允许的内容
标记遗漏没有,起始和结束标签都是强制性的。
允许父级任何接受 phrasing content 的元素。
允许ARIA角色任何
DOM界面HTMLOutputElement

属性

这个元素包含全局属性。

for其它影响计算结果的标签的ID,可以多个。

例子

<form oninput="result.value=parseInt(a.value)+parseInt(b.value)"> <input type="range" name="b" value="50" /> + <input type="number" name="a" value="10" /> = <output name="result">60</output> </form>

规范

SpecificationStatusComment
HTML Living StandardThe definition of '<output>' in that specification.Living Standard
HTML5The definition of '<output>' in that specification.Recommendation

浏览器兼容性

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic Support10(Yes)4No117
for10(Yes)4No117

FeatureAndroidChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic Support(Yes)(Yes)(Yes)4No?(Yes)
for(Yes)(Yes)(Yes)4No?(Yes)