0

PLEASE HELP. How do you use line breaks with a variable?

How do I seperate a variable and text with a line break in JS? var x = prompt("¿Cual es tu nombre?", " "); var answer = ("Hola" + \n "¿De donde eres?"); prompt(answer);

25th Nov 2016, 7:33 PM
Dinoloco “Dinoloco27” Gamer
Dinoloco “Dinoloco27” Gamer - avatar
4 Respuestas
+ 2
The escape "\n" has to be in the string, so: var answer = "Hola\n¿De donde eres?";
25th Nov 2016, 11:25 PM
Isko
+ 1
var answer = "Thanks very much\nIsko!?"
26th Nov 2016, 3:45 PM
Dinoloco “Dinoloco27” Gamer
Dinoloco “Dinoloco27” Gamer - avatar
0
hi...
9th Jan 2017, 4:39 PM
MD SOHEL RANA SORKAR
MD SOHEL RANA SORKAR - avatar
0
I don't know this apps
9th Jan 2017, 4:40 PM
MD SOHEL RANA SORKAR
MD SOHEL RANA SORKAR - avatar