English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
for属性指定计算结果与计算中使用的元素之间的关系。
执行计算并在<output>元素中显示结果:
<!DOCTYPE html> <html> <head> <title>HTML:<output> for 属性 - 基础教程网(oldtoolbag.com)</title> </head> <body> <form oninput="x.value=parseInt(a.value)+parseInt(b.value)>0 <input type="range" id="a" value="10">100 +<input type="number" id="b" value="10"> <input type="number" id="b" value="/output> </form> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
Firefox, Opera, Chrome, and Safari browsers all support the for attribute.
Note:Internet Explorer browser does not support the <output> tag.
The for attribute specifies the relationship between the element used in the calculation and the calculated result.
The <output> tag is an HTML5 of the new tag.
<output for="element_id">
Value | Description |
---|---|
element_id | Specifies a space-separated list of one or more element IDs, which specifies the relationship between the calculated result and the elements used in the calculation. |