Forum Discussion
Nathan_Hilliard
7 months agoCommunity Member
Re: How to insert a carriage return and line feed into a variable using javascript
The 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.
No RepliesBe the first to reply
Related Content
- 10 months ago