Reputation: 3892
I'm working on entering dollar amounts into a text input field. Is there a way when I have direction set to RTL that I can maintain the cursor to be at the farthest right position and keep it there?
<input type="text" id="textArea">
CSS:
#textArea {
direction:RTL;}
This just starts the cursor on the right, but when you type it still moves in the standard fashion. Any help would be appreciated.
Upvotes: 0
Views: 4497
Reputation: 11
Add another attribute to your input that looks something like this:
onkeyup="rtl(this);"
Upvotes: 0
Reputation: 2557
Another solution is to use the dir attribute
<input type="text" dir="rtl" id="textArea">
Upvotes: 0
Reputation: 2777
Since you are dealing with text inside of an input, just use text-align: right;
#textArea{
text-align: right;
}
Upvotes: 3