JSFiddle - React, Tailwind, and code Playground

by rowntreerob

HTML

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

CSS

input[type=file]{
    width:120px;
    color:transparent;
}

JavaScript

window.pressed = function(){
    var a = document.getElementById('aa');
    if(a.value == "")
    {
        fileLabel.innerHTML = "Choose ";
    }
    else
    {
        var theSplit = a.value.split('\\');
        fileLabel.innerHTML = theSplit[theSplit.length-1];
    }
};