JSFiddle - React, Tailwind, and code Playground

by Ketan Patel

HTML

<div><input type='file' title="Choose a video please" id="aa" onchange="pressed()">
<label id="fileLabel small">Choose file</label>
</div>

CSS

input[type=file]{
    width:90px;
    color:transparent;
}
.small {
  
}

JavaScript

window.pressed = function(){
    var a = document.getElementById('aa');
    if(a.value == "")
    {
        fileLabel.innerHTML = "Choose file";
    }
    else
    {
        var theSplit = a.value.split('\\');
        fileLabel.innerHTML = "default text message here<br>"+theSplit[theSplit.length-1];
    }
};