title: How to replace double quotes with space or single quote in jQuery?
body: <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-type" content="text/json;charset=UTF-8"&gt;
  &lt;title&gt;Test&lt;/title&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  jQuery(document).ready(function(jQuery){
      jQuery('input[name="add_custom_search"]').click(function(){
          var searchname = jQuery("#spto_searchname").val();
  
          var obj = {};
          jQuery( ".searchdetails label").each(function(i, el) {
              var label = jQuery(el).text();
              /* remove double quotes */
              var labelrmvdq = label.replace('"','  ');
  
              var labvl = jQuery(el).next().val();
              /* replace double quotes with single */
              var labcl = labvl.replace('"',"'");
  
              obj[labelrmvdq] = labcl;
          });
          console.log(obj);
          var objstr = JSON.stringify(obj);
          var objleftbraces = objstr.replace("{","  ");
          var objrightbraces = objleftbraces.replace("}","  ");
          var objcomma = objrightbraces.replace(",","  ");
  
          alert(objcomma);
  
  });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="" method="POST"&gt;
          &lt;div class="searchdetails"&gt;
              &lt;label for="Postal_Code"&gt;Postal Code&lt;/label&gt;
              &lt;input type="text" name="Postal_Code" value=""/&gt;
  
              &lt;label for="City"&gt;City&lt;/label&gt;
              &lt;input type="text" id="spto_searchname" name="City" value=""/&gt;      
  
              &lt;input type="submit" name="add_custom_search"&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Current output:</strong></p>
  
  <pre><code>  "Postal Code":"654132"  "City":"Portsmouth"  
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <pre><code>  Postal Code: '654132' City:'Portsmouth'
  </code></pre>