11 Vote

JavaScript: Multiline Alert

Tip by Progger99 | Last update on 2024-01-17 | Created on 2011-11-24

Sometimes, you may want to insert a new line in a JavaScript alert and make the alert multiline with this.

Here is how to do it:

alert('1\n2\n3');

The \n stands for a linebreak. In the example, the alert() creates an output of the numbers 1, 2 and 3 under each other.

ReplyPositiveNegative

About the Author

AvatarThe author has not added a profile short description yet.
Show Profile

 

Related Topics

PHP: Sending an E-Mail

Tutorial | 0 Comments

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.