storing an span content to a variable without getting an error

storing an span content to a variable without getting an error

I'm trying to embed a lot of html code into a javascript variable. How do I do that without getting error?

I kinda think that it has something to do with the escape quotation plus x, which I need so that the id won't duplicate.

is there a better way to do this?

Thanks
  1. //add new form
  2.                 //update cached steps in the wizard with a new step (adds one first)
  3.                 $(".addcar").live(click,function(){
  4.                 //step 2 vehicle information content
  5.                 if (x == null)
  6.                 {
  7.                     var x = 0;   
  8.                 }
  9.                 var vcontent = '<span id="vehicle/" + x + /"" class="step">
  10.                         //plus a lot of content          
  11.                     </span>';
  12.                 var icontent = '<span id="insurance/" + x + '"" class="step">
  13.                     <span class="title">Step 3 - Select an Insurance</span><br/>
  14.                         //plus a lot of content
  15.                         </span>
  16.                     </span>';
  17.                     $("#review").before(vcontent);
  18.                     $("#review").before(icontent);
  19.                     $("#signupForm").formwizard("update_steps");
  20.                     x += 1;
  21.                     $(this).attr('disabled','disabled');
  22.                 });