Search code examples
javascripttextboxalignment

How can i align the text to right side in Textbox in Javascript.... ??? By default it is left-align


My problem is that i couldn't align the text in the textbox from the right side...

Generally this kind of align are used in Calculator... where digits are align from the right side...

i want to do this in HTML by using javascript....


Solution

  • <input type="text" style="text-align: right" />

    should work.

    Other interesting attributes are: direction:rtl;unicode-bidi:bidi-override;