THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Bdo dir Property

Bdo Object Reference 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

Internet Explorer Firefox Opera Google Chrome Safari

The dir property is supported in all major browsers.


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 Reference Area Object