Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

Special Characters

In JavaScript you can add special characters to a text string by using the backslash sign.

Insert Special Characters
The backslash (\) is used to insert apostrophes, new lines, quotes, and other special characters into a text string.

Example:
var txt="We are the so-called \"Vikings\" from the north.";
document.write(txt);

JavaScript will now output the proper text string:
We are the so-called "Vikings" from the north.

The table below lists other special characters that can be added to a text string with the backslash sign:


Code

Outputs

\'

single quote

\"

double quote

\&

ampersand

\\

backslash

\n

new line

\r

carriage return

\t

tab

\b

backspace

\f

form feed

 
     
   
JavaScript Tutorial
 
  Introduction
Introduction
  Object Oriented Programming
Object Oriented Programming
  How to
How to
  Where use JavaScript
Where use JavaScript
  Variables
Variables
  Operators
Operators
  if Statement
if Statement
  Switch Statement
Switch Statement
  Functions
Functions
  for Loop
for Loop
  while Loop
while Loop
  Popup Boxes
Popup Boxes
  break and continue Statements
break and continue Statements
  Events
Events
  Date and Time Object
Date and Time Object
  Special Characters
Special Characters
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Data Structures and Algorithms With Object-Oriented Design Patterns in Java  Ebook Data Structures and Algorithms With Object-Oriented Design Patterns in Java
   
Download Article Marketing Success Ebook Article Marketing Success
   
Download C Sharp Introduction Ebook C Sharp Introduction
   
Download Power Profits Workshop Ebook Power Profits Workshop
   
Download How to Think Like a Computer Scientist: Learning with Python   Ebook How to Think Like a Computer Scientist: Learning with Python
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz