I created a button element and added a click event but the click event never fires and so the function deleteFile is never called.
Here is my code:
let innerButtonDiv = document.getElementById("fi");
var innerButtonDelete = document.createElement("button");
innerButtonDelete.innerText = "Del";
innerButtonDelete.onclick = 'deleteFile("f")';
innerButtonDiv.appendChild(innerButtonDelete);
What is wrong and how can I do it the correct way so the function deleteFile gets called?