JSFiddle - React, Tailwind, and code Playground

by Andrei Andrei

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <input type="text" id="txtPath" placeholder="No file selected" />
  <input id="btnBrowse" type="button" onclick="document.getElementById('file').click();" value="Browse..." />
  <input type="file" style="display:none;" id="file" name="file" />
<script>
  document.getElementById("file").addEventListener("change", function(event) {
  let output = document.getElementById("txtPath");
  let files = event.target.files;
	console.log(files);
},false);
</script>
</body>
</html>