1

In jQuery mobile I used a input text :

<input type="text" data-clear-btn="true" id="txt_name_contractor">

and in my css file I set this properties :

direction : rtl
text-align : right

But when I type in this input text , It is left to right . How I should fix this problem?

ofskyMohsen
  • 1,121
  • 1
  • 12
  • 26

1 Answers1

3
function rtl(element) {   
    if(element.setSelectionRange) {
        element.setSelectionRange(0,0);
    }
}

$('.myInput').keyup(function(e) {
    rtl(this);
});

Answer from here, by @Anshul

Fiddle

Community
  • 1
  • 1
erol_smsr
  • 1,454
  • 4
  • 24
  • 49