0
Newline Character does not work
https://code.sololearn.com/WBufZ22Fr82k/#js Check the code please and see how new line character and even space is not recognized in the compiler (at least not in the SOLO Learner compiler) I had to use the <br> tag to move the text to the next line. But I personally like the escape character \n for next line.
5 Answers
+ 2
\n does not work in HTML (in HTML you would need to use <br/>, but you can still use \n with the alert function.
+ 2
You can put the text inside a <pre></pre> block to display content with \n and spaces.
If excessive typing doesn't bother you, you can use in place of a single space. This special character will not be collapsed into single space. But you'd have to deal with the extra work for typing just for typing a space.
+ 1
HTML automatically converts multiple spaces into 1 space.
0
But I had spaces there in the code after the next line character as well. Will that not work as well?
I had mentioned it as:
"\n\n" + " "+"<TEXT_DISPLAYED>"
Next line - agreed does not work.
How about the space mentioned after the next line character and before the text?
0
So, how do I give multiple spaces in case I have to?