Quotation marks in java script?

Soldato
Joined
1 Sep 2005
Posts
10,001
Location
Scottish Highlands
How do I get quotation marks to appear in a java script output? I have the code;

Code:
if (form.item_size.value == "4_3020") {
form.os0.value="30x20"};

Where 30x20 is actually 30"x20", ie inches. But if I put " in it doesn't like it, and if I use " it doesn't like it either. Help?
 
you can either escape them eg

Code:
blah.value="30\"x20\""

or use single quotes around the value like this. now you can use " without escaping them.

Code:
blah.value='30"x20"'
 
Back
Top Bottom