Saturday, November 3, 2018

Separate lines in a long text field


In scripting, instead of using an HTML break <br>, you can simply use '\n' as a separator.

(1) var value = 'here\nthere\neverywhere' ; 
(2) var value = 'here\n' + 'there\n' + 'everywhere' ;

var separator = '\n';
(1) var value = 'Item 1\nItem 2\nItem 3' ;
(2) var value = 'Item 1\n' + 'there\n' + 'everywhere' ;    

No comments:

Post a Comment