JSFiddle - React, Tailwind, and code Playground

by Checha Man

HTML

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

CSS

#file {
    display:none;
}

JavaScript

/** Custom file dialog 
http://stackoverflow.com/questions/3226167/how-to-style-input-file-with-css3-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();