I searched for a solution for a long time but to no avail, so I thought I’d write here because I don’t understand why I’m doing it wrong.
The problem:
a client has a WIX site, so I’m working with a piece of custom javascript code inserted at the end of the page. He asked me to do some operations on two html selects when they change value.
The basic code:
const selectFromHTML = document.getElementById('selectID');
selectFromHTML.addEventListener('change', changeSelect);
function changeSelect() {
console.log("OK");
}
The result:
The result is that it doesn’t work, the console.log doesn’t appear. However, I always get this error “customCssClasses is deprecated, please use formatClassNames instead” which I don’t know what it is related to. I tried to write the code in at least 3 different ways but the result is the same. However, if I use “click” instead of “change”, it works. So the console.log is shown even if the “customCssClasses is deprecated, please use formatClassNames instead” error persists.
The question:
Am I doing something wrong? Is there some block maybe on WIX that I don’t know about? Why click works but change doesn’t?
Thank you so much