Question: how can I reset file input in IE, I used the following and it worked in chrome and FF but not IE 

`fileInputElement.value=""`

what's the alternative in IE ?

Answer: 
If `fileInputElement` is on its own in the form `fileInputForm`, you can do:

```
window.fileInputForm.reset();

```

Otherwise for IE you'll have to replace the element with a clone:

```
fileInputElement.parentNode.replaceChild(
    fileInputElement.cloneNode(true), 
    fileInputElement
);

```
### SOLUTION

The following code worked for me with jQuery. It works in every browser and allows to preserve events and custom properties.

```
var $el = $(fileInputElement);
$el.wrap('<form>').closest('form').get(0).reset();
$el.unwrap();

```

### DEMO

See [this jsFiddle](https://jsfiddle.net/gyrocode/yfeo529g/) for code and demonstration.

### LINKS

* [Clearing <input type='file' /> using jQuery](https://stackoverflow.com/a/13351234/3549014)
* [How to reset file input with JavaScript](https://www.gyrocode.com/articles/how-to-reset-file-input-with-javascript/)