+ 4
\n control character
Why control character \n working in code alert ('Hello \n world'); But doesn't working inside contruction ? document.write('Hello \n world');
2 odpowiedzi
+ 7
Use double quotes when outputting escaped characters, think of them as special. May I ask why you call it the control character, when in fact it's the "new line" character?
Try using element.innerHTML and use break <br> the new line character just looks wrong here. Good luck.
+ 2
The same result with double quotes.
And working with console.log('Hello \n world');
<br> work well with document.write().
Yes you right new line character my mistake in translation.