HTMLDOM出力オブジェクト
出力オブジェクト
Outputオブジェクトは、HTMLの<output>要素を表します。
注: <output>要素はInternet Explorer / Edgeではサポートされていません。
出力オブジェクトにアクセスする
getElementById()を使用して、<output>要素にアクセスできます。
例
var x = document.getElementById("myOutput");
ヒント:フォームの要素コレクションを検索して、<output>要素にアクセスすることもできます。
出力オブジェクトを作成する
document.createElement()メソッドを使用して、<output>要素を作成できます。
例
var x = document.createElement("OUTPUT");
出力オブジェクトのプロパティ
Property | Description |
---|---|
defaultValue | Sets or returns the default value of an <output> element |
form | Returns a reference to the form that contains the <output> element |
htmlFor | Returns the value of the for attribute of an <output> element |
labels | Returns a list of <label> elements associated with the <output> element |
name | Sets or returns the value of the name attribute of an <output> element |
type | Returns which type of HTML element the Output object represents |
value | Sets or returns the value of an <output> element |
標準のプロパティとイベント
Outputオブジェクトは、標準のプロパティとイベントもサポートします。
関連ページ
HTMLリファレンス:HTML <output>タグ