HTMLDOMプレオブジェクト
プレオブジェクト
Preオブジェクトは、HTMLの<pre>要素を表します。
プレオブジェクトにアクセスする
getElementById()を使用して、<pre>要素にアクセスできます。
例
var x = document.getElementById("myPre");
プレオブジェクトを作成する
document.createElement()メソッドを使用して、<pre>要素を作成できます。
例
var x = document.createElement("PRE");
プレオブジェクトプロパティ
Property | Description |
---|---|
width | Not supported in HTML5. Use
style.width instead. Sets or returns the value of the width attribute of the preformatted text |
標準のプロパティとイベント
Preオブジェクトは、標準のプロパティとイベントもサポートします。
関連ページ
HTMLチュートリアル:HTMLテキストフォーマット
HTMLリファレンス:HTML <pre>タグ