HTML DOM HR Object

HR object

The HR object represents the HTML <hr> element.

Access HR object

You can use getElementById() to access the <hr> element:

var x = document.getElementById("myHR");

Try it yourself

Create HR object

You can use the document.createElement() method to create an <hr> element:

var x = document.createElement("HR");

Try it yourself

HR object properties

Properties Description
align

Not supported in HTML5.Please use style.textAlign.

Set or return the alignment method of the horizontal line.

color

Not supported in HTML5.Please use style.color.

Set or return the color of the horizontal line.

noshade

Not supported in HTML5.

Set or return whether the horizontal line should be presented in a solid color (without shadow).

size

Not supported in HTML5.Please use style.height.

Set or return the height of the horizontal line.

width

Not supported in HTML5.Please use style.width.

Sets or returns the width of the horizontal line.

Standard Properties and Events

HR Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <hr> Tag