Javascript Reference – Alert();

Alert() is a methord of the window object. Its display popup boxes with messages(‘Texts’) with OK button.
Usage: alert("Hai Guest");

How to write text with multiple lines in an alert box?

Alert is a mathord of window object. So its can’t read HTML tags. Some commonly used escapes characters listed below:
\n : It inserts a new line
\t : tab
\r : Carriage return
\b : backspace
\f : form feed
\' : Single Quote
\" : Double Quote
\\ : Backslash

Usage: alert("Hai User\n Welcome to My website");
Click here to see the alert mentioned above.

Share with Friends
[Facebook] [Jamespot] [Reddit] [StumbleUpon] [Twitter] [Email]

1 thought on “Javascript Reference – Alert();”

Leave a Reply

Your email address will not be published. Required fields are marked *