const input = document.querySelector('.input__file');
const span = input.nextElementSibling.querySelector('.input__file-button-text');
const originalLabelText = span.innerText;
input.addEventListener('change', (e) => {
let filesCount = '';
if (input.files && input.files.length >= 1)
filesCount = input.files.length;
if (filesCount)
span.innerText = 'Selected files: ' + filesCount;
else
span.innerText = originalLabelText;
});