+ 2
How to have a line break in javascript in alert box?
7 ответов
+ 5
"\n"
alert("\nok\nku")
+ 5
@neicore
can you show an example? it didn't work for me I use \n for JS
update: e.g for html + JS alert txt now
https://code.sololearn.com/W9or0EQuF7gF/?ref=app
+ 4
@neicore
that's html & doesn't work in JS this is JS we are speaking.
+ 2
or you can use the "<br/>" tag,
example "this is an alert" + "<br/>" + "with a line break."
output ;
this is an alert
with a line break.
+ 2
@Lord Krishna, have you ever used the method?
I usually use that
+ 2
you were right bro
https://code.sololearn.com/WHkOp4tNX9qq/?ref=app
+ 1
@neicore sweet alert?