Menu
I had a JS file which applied a querySelector method as below. It worked as a stand alone page with a linked JS file.
I’m now loading the content via a fetch method. How can I get the JS side of it to work.
I’ve tried making the JS part of the file being retrieved via fetch and putting it on the parent page. I get no errors and it doesn’t work.
[code]
document.querySelectorAll(“.drop-zone__input”).forEach(inputElement =>{
var dropZoneElement = inputElement.closest(“.drop-zone”);
dropZoneElement.addEventListener(“click”, e =>{
inputElement.click();
})