Search code examples
phphtmlright-to-left

Type From right to left html / php


I want to make input from with right to left template. I want the first word I type to be placed in the right-most side of the text.

Here's an example:

WORD ; 12345

So I have to type 5 - 4 - 3 - 2 - 1. i'm trying to use direction: rtl, but it just changes the template text from left to right.

<input type="number" style="direction: rtl; background-color: #424242; color: #FFFFFF;border: 0px; width: 350px; font-size: 100px" id="hasil" autofocus="true" onKeyDown="if(event.keyCode==16){check(); return false;}">


Solution

  • Checkout this JSFiddle I just made, this should work for you.

    .right {
        direction: rtl;
        unicode-bidi: bidi-override;
    }
    

    https://jsfiddle.net/db5dvvut/1/