Possible Duplicate:
Double quote in JavaScript string
var array=["famous quote by Shakespear is",""to be or not to be""]
How do I escape the blockquote in the second element of the array which uses "
for delimiting elements?
Possible Duplicate:
Double quote in JavaScript string
var array=["famous quote by Shakespear is",""to be or not to be""]
How do I escape the blockquote in the second element of the array which uses "
for delimiting elements?
Use a backslash:
var str = "famous quote by Shakespear is, \"to be or not to be\"";
var str = 'famous quote by Shakespear is, \'to be or not to be\'';
Or just mix the types of quotes:
var str = "famous quote by Shakespear is, 'to be or not to be'";
var str = 'famous quote by Shakespear is, "to be or not to be"';
You can escape with a backslash or use single quotes around the string:
var array=["famous quote by Shakespear is","\"to be or not to be\""];
var array=["famous quote by Shakespear is",'"to be or not to be"'];
Single and double quotes are interchangeable as long as you pair them correctly.