user496949
user496949

Reputation: 86055

document.writeln not working as expected

With the following line of code:

document.writeln("blahblahblah")

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

Is it expected?

Upvotes: 4

Views: 1232

Answers (1)

Vadim Gulyakin
Vadim Gulyakin

Reputation: 1431

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

Upvotes: 4

Related Questions