document.querySelector('input').files will return a FileList object, like explained above, and using [0] we get the first file loaded, and we can access all the properties we need from the File object:document.
Enhance the :hover effect with additional CSS and apply a slim border to separate the label and input field. Tested in Chrome, Firefox and Edge. You can find the link to the codepen at the following URL: https://codepen.io/glebkema/pen/VwMQWGE. .custom-file-button input[type=f...