For example in the 'Numeral formatting' part of this site link
When I type, numbers begin to be written from right to left, and the default is any input is from left to right.
How do I change the input to be this way when I type?
For example in the 'Numeral formatting' part of this site link
When I type, numbers begin to be written from right to left, and the default is any input is from left to right.
How do I change the input to be this way when I type?
Do not use direction: rtl
for this. Although it produces the expected result, this hurts HTML semantics, since the RTL proposal is to indicate that the content of that element is in a language that is written from right to left: it is a location property, not a formatting property.
As you just want to format the text, use the text alignment property.
input[type=number] {
text-align: right;
}
<input type="number">