title: How can I get variable from another function?
body: <p>My case like this :</p>
  
  <p>Html code (This is modal) :</p>
  
  <pre><code>&lt;div class="modal-body"&gt;
      ...
      &lt;input type="file" id="change-image" name="replace"&gt;
      ...     
      &lt;button type="button" class="btn btn-success" id="confirm-edit-image"&gt;
          Save
      &lt;/button&gt;    
  &lt;/div&gt;
  </code></pre>
  
  <p>If I click input type file, it will run the javascript code :</p>
  
  <pre><code>$('#change-image').change(function (e) {
      data = new FormData();
      data.append('file', $('#change-image')[0].files[0]);
  });
  </code></pre>
  
  <p>There exist variable data image </p>
  
  <p>If I run this :</p>
  
  <pre><code>$('#confirm-edit-image').on("click",function(){
      // get variable data
  });
  </code></pre>
  
  <p>I want to get the variable data image</p>
  
  <p>How can I do it?</p>