THE WORLD'S LARGEST WEB DEVELOPER SITE

Bdo dir Property

❮ Bdo Object

Example

Change the text direction of the text inside a <bdo> element to "right-to-left":

document.getElementById("myBdo").dir = "rtl";
Try it Yourself »

Definition and Usage

The dir property sets or returns the value of the dir attribute of a <bdo> element.

The dir attribute specifies the text direction of the text inside a <bdo> element.

Note: For <bdo> elements, the dir attribute is required.


Browser Support

Property
dir Yes Yes Yes Yes Yes

Syntax

Return the dir property:

bdoObject.dir

Set the dir property:

bdoObject.dir = "ltr|rtl"

Property Values

Value Description
ltr Specifies a left-to-right text direction
rtl Specifies a right-to-left text direction


Technical Details

Return Value: A String, representing the text direction of the text

More Examples

Example

Get the text direction of the text inside a <bdo> element:

var x = document.getElementById("myBdo").dir;

The result of x will be:

rtl
Try it Yourself »

Related Pages

HTML reference: HTML <bdo> dir attribute


❮ Area Object