JSFiddle - React, Tailwind, and code Playground
@author Roman Grinyov <[email protected]>
HTML
<input type="file">
<div></div>
JavaScript
document.querySelector('input').addEventListener('change', function() {
var splittedFakePath = this.value.split('\\');
document.querySelector('div').textContent =
splittedFakePath[splittedFakePath.length - 1];
});