In my HTML page I've the following ul:
<ul id="inFile2"></ul>
and in my JavaScript page, I've this function
function handleFileSelect(event) {
var files = event.target.files; // FileList object
console.log(files);
// files is a FileList of File objects. display first file name
file = files[0];
console.log(file);
if (file) {
readInputFile(file);
console.log(file);
}
}
I want to call the function in the ul. How could that happen? this is what I have tried so far
el=document.getElementById('inFile2');
el.on("change",handleFileSelect);
but gives me an error. What is the correct coding to call that function in the ul?
changeevent does not fire onulelements… if that's whatelis.elis DOM object not a jQuery object. 2. Read @Andy comment once again