how to code text alerts in javascript code example
Example 1: javascript alert get text
var person = prompt("Please enter your name", "Harry Potter");
if (person == null || person == "") {
txt = "User cancelled the prompt.";
} else {
txt = "Hello " + person + "! How are you today?";
}
Example 2: js alert format text
\b = Backspace
\f = Form feed
\n = New line
\r = Carriage return
\t = tab