Need assistance with this code. Although I believe everything is correct, it still isn't working as expected. The error mentioned in the title comes up whenever I try to use it. I've made multiple modifications to the code but it's still not functioning properly. If anyone has any suggestions on how to resolve this issue, please help me out. Thank you:)
let loader = function(e) {
let file = e.target.files;
let show = "Selected File: " + file[0].name;
let output = document.getElementById("selector");
output.innerHTML = show;
output.classList.add("active");
};
let fileInput = document.getElementById("file");
fileInput.addEventListener('change', loader);
<input type="file" accept="video/* image/*" multiple name="" id="selector" hidden>
<label for="file" class="upload" id "selector"> Select a file: </label>