JSFiddle - React, Tailwind, and code Playground
HTML
<form action=""
method="post" enctype="multipart/form-data">
<input type="file" id="file_select" name="file_select" value="">
</form>
JavaScript
var choicefile = document.getElementById('file_select');
choicefile.onchange = function(){
alert('File selected')
}