Inserting a line break in a variable
May 16, 2006 12:00 AM
Search the internet for HTML and line break. I found this.Special charactersIn addition to the functions, there are numerous special characters that may be used to represent key effects. These characters include the following:• t – tab • b – backspace/delete • r – carriage return • n – newline • f – form feedThe most common purpose of special characters is formatting output. For instance, you may need to include a line break to properly display a value. Also, a carriage return is needed to place data on separate lines. On some platforms, "n" will suffice but "rn" is required to display a line break properly on all machines. The following sample displays the special characters in a multi-line window:var output = null;output = "Special Characters";output += "n";output += "===============";output += "n";output += "\t - tab";output += "n";output += "\b - backspace/delete";output += "n";output += "\r - carriage return";output += "n";output += "\n - newline";output += "n";output += "\f - form feed";output += "n";alert(output);cheers, ben
Discussions have been disabled for this post