Document.writeln is not working properly

With the following line of code:

document.writeln("blahblahblah") 

I expect the content to be placed on its own line, but instead the content will be inserted, but without a new line. Only space.

Is it expected?

+4
source share
1 answer

A new line will be displayed only inside the code output tags (pre, code, etc.). In other cases, the browser will convert it to space.

+4
source

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


All Articles