title: Removing quotes OR including quotes when using append
body: <p>I have a variable, PRODUCT_CUSTOM_1_ and PRODUCT_NAME_ . This is suppose to grab the product options from the html that is being displayed. We have a few products that contain quotations, " and '. When we grab these strings and post them elsewhere, it cuts off at the ". I either need the " removed or included within us posting it elsewhere.</p>
  
  <p>How can I remove or include the " and ' from the two variables into my hidden form iwantCheckoutForm?</p>
  
  <p>An example of a product name: 1/8" x 40' roll of tape
  An example of the custom option: 1/8" black, 1/4" red</p>
  
  <pre><code>var BongoCheckout = {insertForm: function() {
  
  var custom =new Array;
  for(i=0;i&lt; qtys.length ;i++){
          custom[i]="";
          for(j=0;j&lt; $($("td.ys_itemInfo")[i]).children().children().length; j++){
               custom[i]= custom[i]+"   "+$($($("td.ys_itemInfo")[i]).children().children()[j]).text();
          }
  
  $("#iwantCheckoutForm").append('&lt;input type="hidden" name="PRODUCT_ID_'+(i+1)+'" value="'+codes[i]+'"&gt;');
  $("#iwantCheckoutForm").append('&lt;input type="hidden" name="PRODUCT_NAME_'+(i+1)+'" value="'+items[i]+'"&gt;');
  $("#iwantCheckoutForm").append('&lt;input type="hidden" name="PRODUCT_PRICE_'+(i+1)+'" value="'+price[i]+'"&gt;');
  $("#iwantCheckoutForm").append('&lt;input type="hidden" name="PRODUCT_Q_'+(i+1)+'" value="'+qtys[i]+'"&gt;');
  $("#iwantCheckoutForm").append('&lt;input type="hidden" name="PRODUCT_CUSTOM_1_'+(i+1)+'" value="'+custom[i]+'" /&gt; ');
  
  if (per_item_shipping) {
  $('form[name="iwantCheckoutForm"]').append('&lt;input type="hidden" name="PRODUCT_SHIPPING_'+(i+1)+'" value="'+shipping_cost.toString()+'"&gt; ');
  } else {
  $('form[name="iwantCheckoutForm"]').append('&lt;input type="hidden" name="PRODUCT_SHIPPING_'+(i+1)+'" value="'+shipping_cost_breakdown+'"&gt; ');
  }
  }}
  </code></pre>
  
  <p>I know that this is a duplicate question sort of, but i couldn't quite figure out how to implement the 10+ suggestions into my current script. I just can't seem to include the regex argument, without the script from breaking. I tried to add it within the for loop.</p>
  
  <pre><code>        for(j=0;j&lt; $($("td.ys_itemInfo")[i]).children().children().length; j++){
               custom[i]= custom[i]+"   "+$($($("td.ys_itemInfo")[i]).children().children()[j]).text(custom.replace(/\"/g, ""));
          }
  </code></pre>
  
  <p>Blame that on me still being a n00b, and blame that on my ADD. I suppose I just don't know where I need to add .replace(/\"/g, "") as this code seems to be working for others.</p>