Say I have a textbox in HTML using the following code:
<input type="text" name="text" id="text" />
And my site is intended to be for right-to-left as well as left-to-right languages. That means that I have some textboxes that will be typed in a right-to-left language, but the email textbox, for example, will be left-to-right.
My question is not how to declare specific direction using CSS. Please no CSS here.
My question is if it's possible to use javascript to automatically detect the language, and seeing if it's a right-to-left language, make the text-direction go from right-to-left, or if it's a left-to-right language, make the text direction go from left-to-right. (AKA, it could possibly auto detect the language, THEN set the CSS "direction: rtl;" or whatever).
Is this possible to accomplish using javascript? (I know google does it in their google translate and various other sites do it as well, I was just wondering if it's difficult to implement)...
Thanks, Amit