HTML DOMOlオブジェクト
オルオブジェクト
Olオブジェクトは、HTMLの<ol>要素を表します。
Olオブジェクトにアクセスする
getElementById()を使用して、<ol>要素にアクセスできます。
例
var x = document.getElementById("myOl");
Olオブジェクトを作成する
document.createElement()メソッドを使用して<ol>要素を作成できます。
例
var x = document.createElement("OL");
Olオブジェクトのプロパティ
Property | Description |
---|---|
compact | Not supported in HTML5. Use style.lineHeight instead. Sets or returns whether the list should render smaller than normal, or not |
reversed | Sets or returns whether the list order should be descending or not |
start | Sets or returns the value of the start attribute of an ordered list |
type | Sets or returns the value of the type attribute of an ordered list |
標準のプロパティとイベント
Olオブジェクトは、標準のプロパティとイベントもサポートします。
関連ページ
HTMLリファレンス:HTML <ol>タグ