title: How to passing data for image src in modal Laravel using jquery
body: <p>Hello i need help to pass the data for my src image in modal using jQuery.</p>
  
  <pre><code>view.blade.php
  @foreach ($users as $user)
   &lt;td&gt;{{$user-&gt;name}}&lt;/td&gt;
   &lt;button class="btn-success showuser" 
    data-id="{{ $user-&gt;id }}" 
    data-userphoto="{{ $user-&gt;user_photo }}"
    data-toggle="modal" data-target="#modal-insert"&gt;
   &lt;i class="fa fa-pencil"  align="center"&gt;Insert Proof&lt;/i&gt;
   &lt;/button&gt;
  @endforeach
  
  $(document).ready(function(){
      //Upload
      $(document).on('click', '.showuser', function() {
      $('#iduser').val($(this).data('id'));
      $('#userphoto').val($(this).data('userphoto'));
      });
  
  });
  </code></pre>
  
  <p>I have id user and userphoto(filename) as data and then i pass it to my modal</p>
  
  <pre><code>&lt;div class="modal fade" id="modal-insert"&gt;
  &lt;div class="modal-dialog" role="document"&gt;
  &lt;div class="form-group"&gt;
   &lt;input type="number" name="id" id="iduser"&gt;
   &lt;/div&gt;
   &lt;div class="form-group"&gt;
   &lt;input type="file" class="form-control" name="user_photo" id="userphoto"&gt;
   &lt;img style="max-width: calc(100% - 20px)" src="/storage/(**contain id="userphoto"**)"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How to make my src can contain the value of id="userphoto" ?
  Thanks for the suggestion</p>