title: Save and load an image from input
body: <p>I created a form with input type = file. After submitting from information from this form goes to localstorage and add to some block. I can add text, but can't add image, not a file name, but a real image. </p>
  
  <p>So the result should look like div with some text info inside and a real image from the user pc</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let outputs = $('.output-text');
    let idMask = "outputs_";
    function showArticle(){
      let isLen = localStorage.length;
      if(isLen &gt; 0){
          for(let i = 0; i &lt; isLen; i++){
              let key = localStorage.key(i);
              if(key.indexOf(idMask) == 0){
                  $('&lt;div&gt;&lt;/div&gt;').addClass('student-card')
                      .attr('data-itemId', key)
                      .html(localStorage.getItem(key))
                      .prependTo(outputs);
              }
          }
      }
  }
  
  showArticle();
  
  
  $(".load-form").on('submit', function(event) {
      event.preventDefault();
  
      let groupName = $(this).find('#select-group option:selected').text();
      let pupilName = $(this).find('#select-pupil option:selected').text();
      let message = $(this).find('#textarea').val();
      let inputImg = $(this).find('#file-name').text();
      let addArticle = '&lt;div class = "student-card__group"&gt;Group: &lt;span class = "group-name_js"&gt;'+groupName'+
   '&lt;/span&gt;&lt;/div&gt;&lt;div class = "student-carg__img"&gt;'+inputImg+'&lt;/div&gt;';
  
      let newId = 0;
      outputs.children().each(function(index, el){
          let oldId = $(el).attr('data-itemId').slice(8);
          if(oldId &gt; newId)
              newId = oldId;
      })
      newId++;
  
      localStorage.setItem(idMask+newId, addArticle);
  
      $('&lt;div&gt;&lt;/div&gt;').addClass('student-card')
          .attr('data-itemId', idMask+newId)
          .html(addArticle).prependTo(outputs);
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form class = "load-form" method="get" enctype="multipart/form-data"&gt;
      &lt;div class = "load-form-item choose-group"&gt;
          &lt;select id = "select-group"&gt;
            &lt;option&gt;1&lt;/option&gt;
            &lt;option&gt;2&lt;/option&gt;
            &lt;option&gt;3&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class = "load-form-item"&gt;
         &lt;input type = "file"&gt;
      &lt;/div&gt;
      &lt;div class = "load-form-item load-form-item__submit"&gt;
        &lt;input type = "submit"&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;div&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>