JavaScript Special Characters

JavaScript support special characters to text string using backslash Sign(\).

Following table list are JavaScript special characters that can add to text string with the backslash sign:

Special Character Description
\' single quote
\" double quote
\& ampersand
\n new line
\t tab
\\ backslash
\r carriage return
\b backspace
\f form feed
\v vertical tab
\0 null character

Note that the \v and \0 escapes are not allowed in JSON strings.


<!DOCTYPE html>
<html lang="en">
  <title>JavaScript Special Character</title>
    <script type="text/javascript">
        document.write("This example represent \"double quote\" special character.");

Run it...   »

Example Result