JSFiddle - React, Tailwind, and code Playground

HTML

<!doctype html>
<html>
<head></head>
<body>
    <input type="file" id="file-btn" />
</body>
</html>

JavaScript

var f = document.getElementById('file-btn');
f.click();
alert('hello world');