JSFiddle - React, Tailwind, and code Playground
HTML
<input type="file" id="uploadControl">
JavaScript
const uploadControl = document.getElementById('uploadControl');
uploadControl.addEventListener('click', function () {
this.value = '';
});
uploadControl.addEventListener('change', function () {
// IE11 fix
if (this.files.length === 0) {
return;
}
console.log(this.files);
});