开发者

how to inject line feeds into dynamically created html (javascript)

开发者 https://www.devze.com 2023-01-08 07:18 出处:网络
I\'m creating HTML from javascript c开发者_Go百科ode. What character(s)/escape codes should I add to the long html to cut the html into smaller lines (in the html source level, not in the rendered h

I'm creating HTML from javascript c开发者_Go百科ode.

What character(s)/escape codes should I add to the long html to cut the html into smaller lines (in the html source level, not in the rendered html result)?


You can use \n for unix/linux or \n\r for Windows.

Example:

var someString = 'Hello ' + 'Wordl\n';
someString += 'Hello ' + 'Wordl Again\n';
0

精彩评论

暂无评论...
验证码 换一张
取 消