HTML and CSS Reference
The message for the alert dialog box is any valid expression, variable, or a string of
text enclosed in matching quotes, and sent as a single argument to the alert() method.
HTML tags are not rendered within the message string but you can use the escape
sequences, \n and \t . A word of caution: Don't overuse the alert box on your Web site. It
can be seriously annoying for visitors. Use the alert box for its intended purpose: to alert
visitors about input or processing problems and briefly explain how to correct them.
alert("String of plain text");
alert("Phone number is incorrect");
alert(a + b);
<body bgcolor="yellow" text="blue">
<b>Testing the alert method</b><br />
document.write("It's a bird, ");
document.write("It's a plane,<br />");
alert("It's Superman!") ;
stand HTML tags unless they are embedded in a string.
The document.write() method sends its output to the browser.
The alert() method will produce a little dialog box, independent of the current
document, and all processing will be stopped until the user clicks the OK button.
This little box can be moved around the screen with your mouse.