Forum Discussion
JohnnieMoore
8 months agoCommunity Member
How to insert a carriage return and line feed into a variable using javascript
How to insert a carriage return and line feed into a variable using javascript
- Wonderful, Thank you 
2 Replies
- Nathan_HilliardCommunity MemberThe simplest way is to just add <br> into the string where you want it to break. You can do this directly in Storyline when assigning the variable value. Storyline accomodates some very basic formatting directly: For more control, you can insert escape characters into the string in JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#escape_sequences Write the modified string back to a SL in the usual way using SetVar(). Keep in mind that SL textboxes will not automatically resize to accomodate dynamic content in variables. Make your text box the desired size and set to Do not autofit. 
- JohnnieMooreCommunity MemberWonderful, Thank you 
Related Content
- 11 months ago