I want access my method that is in my class after i upload some file but i am getting error that function is not defined.
my html:
<input type="file" id="myFiles">
my javascript:
class fileRead{
constructor(){
this.myInput = document.getElementById("myFiles");
}
addListener = () =>{
this.myInput.addEventListener('change', function(){
this.call(this);
})
}
call = (fileData) =>{
console.log(fileData);
}
}
const a = new fileRead();
a.addListener();