JSFiddle - React, Tailwind, and code Playground

by hardiksondagar

HTML

<div id="file">Chose file</div>
<input type="file" name="file" />

CSS

#file {
    display:none;
}

JavaScript

var wrapper = $('<div/>').css({height:0,width:0,'overflow':'hidden'});
var fileInput = $(':file').wrap(wrapper);

fileInput.change(function(){
    $this = $(this);
    $('#file').text($this.val());
})

$('#file').click(function(){
    fileInput.click();
}).show();