textarea
has an attribute dir
which can accept the value auto
. This makes the textarea automatically switch to RTL mode when the first letter is from an RTL language.
How can I get the current direction of the textarea in JS (that is whether it is actually RTL or LTR, not 'auto') so I can handle the text differently in my code?