JSFiddle - React, Tailwind, and code Playground
HTML
<input type='file' value='C:\fakepath' onchange="previewFile()"/>
JavaScript
function previewFile() {
alert("a");
}
<input type='file' value='C:\fakepath' onchange="previewFile()"/>
function previewFile() {
alert("a");
}