JavaScript: alert() with line break
Question by Compi | 2016-08-25 at 22:43
I would like to output some information using the JavaScript dialog alert(). The problem is that the text is becoming messy if it is too long.
Therefore, I am searching for a possibility to create a multi-line message box with wordwrap. Is this possible using JavaScript?
Related Topics
Rewrite Text Files with a fixed Line Length
Tutorial | 0 Comments
Repair Text Files with mixed Line Breaks
Tutorial | 0 Comments
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
jQuery: Assign Action to Keyboard Keys (Keyboard Event)
Tip | 0 Comments
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
JavaScript: Catch Submit of Form
Tutorial | 0 Comments
JavaScript: Create and Use Arrays
Info | 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.
Yes, you can create a line break with inserting a \n into your string.
For example like that:
The \n will be replaced by a jump into the next line when outputting, so that this example creates a message dialog containing A, B and C under each other each letter in a separate line.
2016-08-26 at 17:29