New line in JavaScript alert box

\n will put a new line in – \n being a control code for new line.

alert("Line 1\nLine 2");

Leave a Comment