Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q37 How do I embed single and double quotes within a string?

irt.org | Knowledge Base | JavaScript | Text | Q37 [ previous next ]

Q37 How do I embed single and double quotes within a string?

One of the following methods should let you do what you want:

<script language="JavaScript"><!--
var text = "singe quote - ' - example<br>";
document.write(text);
var text = 'double quote - " - example<br>';
document.write(text);
var text = "single and double - \' - \" example<br>";
document.write(text);
var text = 'another single and double - \' - \" example<br>';
document.write(text);
//--></script>

Feedback on 'Q37 How do I embed single and double quotes within a string?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.