Element.dir (Property)

The text direction of the Element object content.

Availability:

DOM level - 1
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myElement.dir
-myElement.dir = aDirection
Argument list:aDirectionA value that indicates leftwards or rightwards text drawing

The dir property may be set to indicate a left to right or right to left parsing direction.

This is part of the localization support and represents the contents of the DIR tag attribute.

If you assign a value to this property it is case sensitive and must be either "ltr" or "rtl".

This property works in conjunction with the lang property to control the direction of text flow.

On MSIE 5.0 for Macintosh, this can reverse the order of the table columns so they are drawn right to left, but present the items in the cells still written left to right. This may be because tables block the inheritance of style attributes from the outer containing elements into the table cells.

See also:BDO.dir, Element object, NOFRAMES.dir, NOSCRIPT.dir