title: Uncaught SyntaxError while dynamically generating a select field
body: <p>I have an issue with my <code>append</code> function. I was trying to show an image within a select <code>option</code> by using values from a database which works fine but users can add more <code>option</code>s dynamically by generating a select <code>option</code> using the <code>append</code> function - but I'm getting this error;</p>
  
  <blockquote>
    <p>Uncaught SyntaxError: missing ) after argument list...</p>
  </blockquote>
  
  <p>Here's the code that works fine; </p>
  
  <pre><code>&lt;select data-show-subtext="true" class=" selectpicker bs-select form- 
    control" data-live-search="true" data-size="8" name="city"&gt;    
     &lt;option value=""&gt;&lt;/option&gt;    
     &lt;?php foreach($get_drawing as $row):  $image=$row-&gt;image;  ?&gt; 
     &lt;option data-subtext="&lt;img width='28%' height='90%''  src='&lt;?=base_url("drawing/fabricator/admin_3/".$row-&gt;image);?&gt;'&gt;"  
  value="&lt;?php echo $row-&gt;drawing_id; ?&gt;"  &gt;
   &lt;?php echo $row-&gt;drawing_name;?&gt; 
  &lt;/option&gt;
  </code></pre>
  
  <p>And here's the <code>append</code> code: </p>
  
  <pre><code>$('#add').click(function(){
      j++;
      $('#dynamic_field').append('&lt;div id="row'+j+'" class="row" style="margin-bottom:15px;"&gt;&lt;hr&gt;&lt;div class=col-sm-1 form-group-sm" style="margin-top:25px; margin-bottom:10px;"&gt;&lt;button type="button" name="remove" id="'+j+'" class="btn btn-danger btn_remove"&gt; &lt;i class="fa fa-close"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/div&gt;&lt;div class="col-sm-2  form-group-sm"&gt; &lt;label class="control-label"&gt;Drawing&lt;/label&gt;   &lt;select data-show-subtext="true" class=" selectpicker bs-select form-control" data-live-search="true" data-size="8" name="city"&gt;&lt;option value=""&gt;&lt;/option&gt;&lt;?php  foreach($get_drawing as $row):  ?&gt;&lt;option data-subtext=&lt;img width='28%' height='90%''  src='&lt;?=base_url("drawing/fabricator/admin_3/".$row-&gt;image);?&gt;'&gt;" value="&lt;?php echo $row-&gt;drawing_id; ?&gt;"  &gt;&lt;?php echo $row-&gt;drawing_name;?&gt;  &lt;/option&gt;&lt;?php endforeach; ?&gt;&lt;/select&gt;&lt;/div&gt;&lt;div class="col-sm-1 form-group-sm"&gt;&lt;label class="control-label"&gt;Type&lt;/label&gt;&lt;input type="text" placeholder="Bed Front" class="form-control sm" name="type" value="22"/&gt; &lt;/div&gt;&lt;div class="col-sm-2 form-group-sm"&gt;&lt;label class="control-label"&gt;Profile Series&lt;/label&gt;&lt;input type="text" placeholder="Bed Front" class="form-control" value="22" name="pf"/&gt; &lt;/div&gt;&lt;div class="col-sm-2 form-group-sm"&gt;&lt;label class="control-label"&gt;Location&lt;/label&gt;&lt;input type="text" placeholder="Bed Front" class="form-control" value="22" name="location"/&gt;&lt;/div&gt;&lt;div class="col-sm-1 form-group-sm"&gt;&lt;label class="control-label"&gt;Width&lt;/label&gt;&lt;input type="text" placeholder="Bed Front" class="form-control" value="22" name="width"/&gt; &lt;/div&gt;&lt;div class="col-md-1 form-group-sm"&gt;&lt;label class="control-label"&gt;Height&lt;/label&gt; &lt;input type="text" placeholder="Bed Front" class="form-control" value="22" name="height"/&gt; &lt;/div&gt; &lt;div class="col-md-1 form-group-sm"&gt;&lt;label class="control-label"&gt;Quantity&lt;/label&gt; &lt;input type="text" placeholder="Bed Front" class="form-control" value="22" name="quantity"/&gt; &lt;/div&gt;                                                                         &lt;div class="col-md-1 form-group-sm"&gt; &lt;label class="control-label"&gt;Fixed&lt;/label&gt; &lt;input type="text" placeholder="Height" class="form-control" value="" name="fixed_height"/&gt;&lt;br&gt;&lt;input type="text" placeholder="Height" class="form-control" value="" name="fixed_width"/&gt;&lt;/div&gt;&lt;/div&gt;');
          $('.selectpicker').selectpicker('render');          
          });
  </code></pre>
  
  <p>According to my knowledge the problem is with this line but I don't know how to correct the code in my <code>append</code> function because if I change it, it doesn't work.</p>
  
  <pre><code>  data-subtext="&lt;img width='28%' height='90%''  src='&lt;?=base_url("drawing/fabricator/admin_3/".$row-&gt;image);?&gt;'&gt;"  
  </code></pre>
  
  <p>Thanks in advance.</p>