Html-output-tag

提供:Dev Guides
移動先:案内検索

HTML-<出力>タグ

説明

HTML <output>タグは、計算の結果を指定します。

<!DOCTYPE html>
<html>

   <head>
      <title>HTML Output Tag</title>
   </head>

   <body>
      <form oninput = "sumresult.value = parseInt(z1.value)&plus;parseInt(z2.value)&plus;parseInt(z3.value)">
         <input type = "range" name = "z1" value = "0"/> +
         <input type = "number" name = "z2" value = "20"/> +
         <input type = "number" name = "z3" value = "40"/><br/>
         The output is: <output name = "sumresult"></output>
      </form>
   </body>

</html>

これは、次の結果を生成します-

グローバル属性

このタグは、− link:/html/html_attributes_reference [HTML属性リファレンス]で説明されているすべてのグローバル属性をサポートします

特定の属性

HTML <output>タグは、次の追加属性もサポートしています-

Attribute Value Description
forhtml-5 for List of IDs of other elements, i.e it indicates the elements who have contributed input value to the calculation.
formhtml-5 form Enables to place output elements anywhere within a document.
namehtml-5 name It is the name of the element.

イベント属性

このタグは、link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートしています。

ブラウザのサポート

Chrome Firefox IE Opera Safari Android
Yes Yes No Yes Yes No