$(document).ready(function () {
$(document).on('click', "button", function (e) {
$(this).closest('tr').remove();
});
});
var filelist = new Array();
updateList = function () {
var input = document.getElementById('fileUploader');
var output = document.getElementById('divFiles');
var HTML = "<table>";
for (var i = 0; i < input.files.length; ++i) {
filelist[i] = input.files.item(i).name;
HTML += "<tr><td>" + filelist[i] + "</td><td> <button ></button></td></tr>";
}
HTML += "</table>";
output.innerHTML = HTML;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="form-group col-md-2 col-sm-2">
<label class="label1">
<img src="~/Images/upload.png" height="50px" width="50px" /> Upload Your File
<input type="file" name="fileUploader" id="fileUploader" multiple onchange="javascript:updateList()" />
</label>
</div>
<br />
In the code I am uploading multiple files. When I am trying to upload some more files the existing file list replaced with new list. Even after placing my array outside the function.

updateListfunctionfilelist[i] = input.files.item(i).name;instead of using something likepush. It means that if your first selection has more files than your newest, the last files from the first selection are still in the array, am i right?