Hi,
I try to add an eventlistener to an button with getElementById()
like shown here: https://developer.adobe.com/indesign/uxp/resources/recipes/html-events/
But only the inline version works. If I add a my listener like:
const addHeaderImgBtn = document.getElementById("headerImg");
addHeaderImgBtn.addEventListener("click", showHeaderimg);
with this I get the error getElementById is not a function
. Have I to import first a class or something else?
Best regards