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