How to Right-Align Text Entry Text with javascript? | XM Community
Solved

How to Right-Align Text Entry Text with javascript?

  • 19 July 2018
  • 2 replies
  • 156 views

Within a text entry box for a matrix table question, is there a way to right-align the text within the text entry box using javascript?

I've seen a post about right aligning the box itself, but not one about right aligning the text within the box. Many thanks!
icon

Best answer by TomG 19 July 2018, 14:09

View original

2 replies

Userlevel 7
Badge +27
Add the following to the addOnload function:
```
jQuery("#"+this.questionId+" input[type=text]").css("text-align", "right");
```
Many thanks! Works perfectly!

Leave a Reply