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