New jQuery string \ n

Possible duplicate:
What is the cleanest way to write a multi-line string in JavaScript?

How to jump to a new line when writing jQuery code, and not on the actual code output, for example:

$('#foo').append('<div id="bla"> '+\n+' </div>'); 

Something like that.

+6
source share
1 answer
 $('#foo').append('<div id="bla"> \ </div>'); 

A slash (\) eludes a newline, allowing the line to span multiple lines

+17
source

Source: https://habr.com/ru/post/889835/


All Articles