Can I do that?
I mean if, for example, the contents of the <div> is Hebrew or Arabic, float the <div> right and give it a dir="rtl" attribute. And, if the contents of the <div> is English, float to the left and change the dir attribute to "ltr".
Ss that possible?
If you don't know the language, you can use regular expression to find hebrew or arabic characters, and then set the direction accordingly.
Use regular expressions to find Hebrew: Javascript - how to find hebrew?
All unicode blocks, which you can use to edit the above solution to fit also Arabic: http://www.regular-expressions.info/unicode.html#block
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With