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.
Hello, your articles here Javascript Reference – Alert(); | bijusubhash.com to write well, thanks for sharing!