Search code examples
javascriptinputright-to-left

How to type right to left in HTML?


Couldn't find anything that does this (have Googled already).

Using JavaScript or CSS or HTML, is there a cross browser way to facilitate typing right to left for Arabic languages?


Solution

  • You should look better. Anyways, here's a working solution I have found:

    <input type="text" class="rtlText">
    
    .rtlText{ 
      direction:rtl;
      unicode-bidi:bidi-override; 
    }
    

    This not only makes the input go from right to left, but also makes the characters themselves be typed right to left.

    Here's a JSFiddle: https://jsfiddle.net/gurvinder372/o440xcun/