HTML DOMHRオブジェクト
HRオブジェクト
HRオブジェクトは、HTMLの<hr>要素を表します。
HRオブジェクトにアクセスする
getElementById()を使用して、<hr>要素にアクセスできます。
例
var x = document.getElementById("myHR");
HRオブジェクトを作成する
document.createElement()メソッドを使用して<hr>要素を作成できます。
例
var x = document.createElement("HR");
HRオブジェクトのプロパティ
Property | Description |
---|---|
align | Not supported in HTML5. Use style.textAlign instead. Sets or returns the alignment of a horizontal line |
color | Not supported in HTML5. Use style.color instead. Sets or returns the color of a horizontal line |
noshade | Not supported in HTML5. Sets or returns whether a horizontal line should render in one solid color (noshaded) |
size | Not supported in HTML5. Use style.height instead. Sets or returns the height of a horizontal line |
width | Not supported in HTML5. Use style.width instead. Sets or returns the width of a horizontal line |
標準のプロパティとイベント
HRオブジェクトは、標準のプロパティとイベントもサポートします。
関連ページ
HTMLリファレンス:HTML <hr>タグ