Change the text direction of the text inside a <bdo> element to "right-to-left":
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.
The dir property is supported in all major browsers.
Return the dir property:
Set the dir property:
Value | Description |
---|---|
ltr | Specifies a left-to-right text direction |
rtl | Specifies a right-to-left text direction |
Return Value: | A String, representing the text direction of the text |
---|
Get the text direction of the text inside a <bdo> element:
The result of x will be:
HTML reference: HTML <bdo> dir attribute