JSFiddle - React, Tailwind, and code Playground

by gregorypratt

HTML

<input type="button" id="get_file" value="Grab file">
<input type="file" id="my_file">

CSS

#my_file {
    display: none;
}

#get_file {
    background: #f9f9f9;
    border: 5px solid #88c;
    padding: 15px;
    border-radius: 5px;
    margin: 10px;
    cursor: pointer;
}

JavaScript

document.getElementById('get_file').onclick = function() {
    document.getElementById('my_file').click();
};