New course! Every coder should learn Generative AI!
Try a free lesson0
How to use \n in JS?
3 Answers
+ 1
If \n doesn't work, try <br />.
0
\n is commonly used in alerts or in modifying innerHTML or innerText. It signifies a line break.
0
That only works in innerHTML