How to Right-Align Text Entry Text with javascript? | Experience Community
Skip to main content
Solved

How to Right-Align Text Entry Text with javascript?

  • Jul 19, 2018 4:19 AM UTC
  • 2 replies
  • 408 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!

Best answer by TomG

Add the following to the addOnload function: ``` jQuery("#"+this.questionId+" input[type=text]").css("text-align", "right"); ```
View original

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • Jul 19, 2018 12:09 PM UTC
Add the following to the addOnload function: ``` jQuery("#"+this.questionId+" input[type=text]").css("text-align", "right"); ```

  • Author
  • Jul 19, 2018 9:02 PM UTC
Many thanks! Works perfectly!