JSFiddle - React, Tailwind, and code Playground
HTML
<input id='button' type='file' name='file'/>
<div id='out'>Output Goes Here</div>
JavaScript
$('#button').unbind('change');
$('#button').bind('change', function () {
if(this.files[0] !== undefined && this.files[0] !== null) {
document.getElementById("out").innerHTML = "Type is " + this.files[0].type.toString();
} else {
throw "Error"
}
});