最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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....

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....

Share Improve this question asked Feb 23, 2011 at 13:53 hiren gamithiren gamit 2,1736 gold badges25 silver badges23 bronze badges 2
  • use css or style tag in html with text-align: right – Tae-Sung Shin Commented Nov 14, 2012 at 2:27
  • possible duplicate of How can I right-align a text box? – Tae-Sung Shin Commented Nov 14, 2012 at 2:28
Add a ment  | 

1 Answer 1

Reset to default 3

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

should work.

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

发布评论

评论列表(0)

  1. 暂无评论