JSFiddle - React, Tailwind, and code Playground

by andrea cavattoni

HTML

<input type='file' id='upload'/>
<div id="test" style="height:40px;width:40px;background-color:red;"></div>
<style>
    #upload{
        position:absolute;
    left:-1000px;
    }
</style>

JavaScript

$('#test').on('click', function(){
    setTimeout(function(){
    console.log('go');
	$('#upload').trigger('click');
    }, 3000);
});