brain fade. just the most recent episode:). | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 21

brain fade. just the most recent episode:).

I have tried putting \n in a text line using document.write. It's not outputting linebreaks. I'm doing something wrong for sure, it isnt an issue with the IDE. Could somebody tell me how to put carriage returns in please, thank you. Why would \n not be working?

14th Mar 2017, 9:37 PM
‎‏‎‏‎Joe
‎‏‎‏‎Joe - avatar
7 ответов
+ 30
Well I know it's solved but instead of \n use \r\n.
15th Mar 2017, 2:52 AM
Ram chandra Giri
Ram chandra Giri - avatar
+ 20
thank you all. all fixed. I had used the <br> before like Tashi said. major brain fade.
14th Mar 2017, 10:50 PM
‎‏‎‏‎Joe
‎‏‎‏‎Joe - avatar
+ 19
thank you Ram, i was trying to use escapes so your suggestion is very helpful!
15th Mar 2017, 4:50 AM
‎‏‎‏‎Joe
‎‏‎‏‎Joe - avatar
+ 14
<br> You are using it in your recently published code.
14th Mar 2017, 9:41 PM
Tashi N
Tashi N - avatar
+ 5
web not my strongest but try inserting a break tag I.e "split line after this <br> this is a new line"
14th Mar 2017, 9:42 PM
Elric Hindy
Elric Hindy - avatar
+ 3
use '<br>'
14th Mar 2017, 9:40 PM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
+ 3
brain fade, hate it when that happens! occasionally i find myself drooling on my keyboard like I've had a stroke before I eventually Google the hell out of it because I can't even remember the words to explain it. eventually I find someone else who also asked "how do you do the thing with <insert language> when you want a thing to happen after trying to do that <command> and it errors like, you know, bad"... considering I usually find an answer it means it happens to all of us...or well enough of us to that it is posted deep in some forum on the net..
15th Mar 2017, 5:00 AM
Elric Hindy
Elric Hindy - avatar