Bdo dir attribute
Definition and usage
dir
Sets or returns the value of the dir attribute of the <bdo> element.
<bdo> dir attribute Specifies the text direction of the text inside the <bdo> element.
Note:For the <bdo> element, the dir attribute is required.
See also:
HTML Reference Manual:HTML <bdo> Tag
Example
Example 1
Change the text direction of the text inside the <bdo> element to "right to left":
document.getElementById("myBdo").dir = "rtl";
Example 2
Get the text direction of the text inside the <bdo> element:
var x = document.getElementById("myBdo").dir;
Syntax
Return dir attribute:
bdoObject.dir
Set dir attribute:
bdoObject.dir = "ltr|rtl"
Attribute Value
Value | Description |
---|---|
ltr | Specifies the text direction from left to right. |
rtl | Specifies the text direction from right to left. |
Technical Details
Return value: | String value, representing the text direction of the text. |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Related Pages
HTML Reference Manual:HTML <bdo> dir Atributo