Element dir Property Syntax:
element.dir; element.dir = newValue;
Element dir Property Input Value
The value we set for this property is the same as those that we could use for the dir attribute.
These values are:
“ltr”: which means left-to-right text direction.
“rtl”: which means right to left text direction.
“auto”: this is the default value and means the browsers should decide the direction by itself.
Element dir Property Return Value
The return value of this property is the current value set for the target element’s dir attribute.
Note: if this attribute is not set for the target element, the return value will be an empty string.