JSFiddle - React, Tailwind, and code Playground

HTML

<input type='file' value='C:\fakepath' onchange="previewFile()"/>

JavaScript

function previewFile() {
        alert("a");
}