title: Javascript - double quotes in variable
body: <p>I am trying to create html tags dynamically using javascript. Please refer to below code. </p>
  
  <pre><code>function getPhotosSuccess(data) {
  
      if (data.d.results.length &gt; 0) {
  
          var response = data.d.results;
          var innerhtml = "";
  
          $.each(response, function(key, value) {
              var newItem = '&lt;div class="item"&gt;&lt;div class="well"&gt;&lt;a href="' + value.ServerRelativeUrl + '" data-lightbox="roadtrip" data-title="' + value.ListItemAllFields.Image_x0020_Description + '"&gt;&lt;img class="img-responsive" src="' + value.ServerRelativeUrl + '" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;' + value.ListItemAllFields.Image_x0020_Description + '&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;';
              innerhtml += newItem;
          });
  
          $("#masonryPicGallery .row:eq(0)").html(innerhtml);
  
      } else {
  
          console.log("empty response from server"); 
      }
  }
  </code></pre>
  
  <p>My problem is, here variable <code>value.ListItemAllFields.Image_x0020_Description</code> contains a string that starts with double quote. </p>
  
  <p>So my html renders as following --></p>
  
  <p><a href="https://i.stack.imgur.com/VRECJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VRECJ.png" alt="enter image description here"></a></p>
  
  <p>Can anybody please help me out with this scenario. </p>