Hi, how do i make the "br>" go away? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Hi, how do i make the "br>" go away?

The "br>" is shown on the allert box, but if i delet it from the code, it won't run

22nd Apr 2018, 5:10 PM
Yosef
Yosef - avatar
6 Antworten
+ 18
Yosef in alert u should write \n instead of <br> as new line character check out this link for more 👇 https://googleweblight.com/i?u=https://stackoverflow.com/questions/1841452/new-line-in-javascript-alert-box&hl=en-IN&geid=1026
22nd Apr 2018, 5:15 PM
🌛DT🌜
🌛DT🌜 - avatar
+ 18
Yosef \n is new line character /n is string \ is different than /
22nd Apr 2018, 5:24 PM
🌛DT🌜
🌛DT🌜 - avatar
+ 7
for (i=1, text="missipie"; i<=5; i++) { alert (i+text +"\n"); }
22nd Apr 2018, 5:22 PM
Mohammad Ismail
Mohammad Ismail - avatar
+ 1
It doesn't work, should the /n be a string?
22nd Apr 2018, 5:24 PM
Yosef
Yosef - avatar
+ 1
Ohh, i see i did /n instead of \n...
22nd Apr 2018, 5:25 PM
Yosef
Yosef - avatar
0
Thx u guys
22nd Apr 2018, 5:25 PM
Yosef
Yosef - avatar