I'm making an app that lets users upload stuff. I am trying to set the onclick callback of an upload button to a function by doing this inside one of my classes:
this.uploadMusicButton.onclick = "upload('music' + this.frameNum)";
// ^ this code is inside of a custom class
// the code below is outside of any js class
function upload(purpose)
{
alert("made it here");
uploadPurpose = purpose;
document.getElementById("openFile").click();
}
But when I try clicking the button, nothing happens. Can someone please help me?