JSFiddle - React, Tailwind, and code Playground

by mesak

HTML

<script type="text/javascript">
    function inputBtn(){
    var input=document.createElement('input',{type:'file'});
    //input.type="file";
    
    setTimeout(function(){
        input.click();
    },200);
    //without this next line, you'll get nuthin' on the display
    document.getElementById('target_div').appendChild(input);
}
</script>

<button id="ifile" onclick="inputBtn();">create</button>
<div id="target_div"></div>