aboutsummaryrefslogtreecommitdiff
path: root/app/static/file.js
blob: 403ddf669c16b46422250a981511d36e27b2c863 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
window.onload = function() {
    const fileInput = document.querySelector("#file-js input[type=file]");
        if (fileInput !== null) {
            fileInput.onchange = () => {
            if (fileInput.files.length > 0) {
                const fileName = document.querySelector("#file-js .file-name");
                fileName.textContent = fileInput.files[0].name;
            }
        }
    };
}