Skip to content
Advertisement

New line string from javascript

I cant do new line from javascript, I tried to do that with n, but nothing.

JavaScript
JavaScript

Advertisement

Answer

Apparently you are pretty new in javascript. You should use <br> instead. n new line for console outputs. Also you should use innerHTML instead of textContent.

JavaScript
JavaScript

With textContent

JavaScript
JavaScript

Console example:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement