Use of Special Character in JavaScript

In this article I have described about special text or character JavaScript such Escape character.
  • 2279

JavaScript Special Text

  • There are some special character which allow us to break our program.
  • Such as Backslash (/) is known as Escape character.

Syntax

Consider the following code without escape character

<script type="text/javascript">

<!--
           document.write("It is known as an "escape" character");
//-->
</script>

JavaScript Code with escape character

<script type="text/javascript">

<!--
          document.write("It is known as an \"escape\" character");
//-->
</script>

There are some special characters used in JavaScript program are as follow

      Code      Meaning
\t Tab
\n New Line
\b Backspace
\v Vertical Tab
\\ Backslash
\" Double quotation mark (")
\' Single quotation mark (')
\r carriage return
^ check beginning of input

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.