Working on preview but not published

Hi,
I have collapsing boxes throughout my site, same structure on every pages. When in preview every thing works nicely but when I go on my published site only one of the pages works correctly.
I have went through the code of all the pages again but can not find why!

page where it works: https://www.charlesdubois.co/measures
one of the page where it does not: https://www.charlesdubois.co/planes 7

Any help would be much appreciated
Thanks
Charles

Hi Charles,

Can you provide screenshots to illustrate the differences?

Thanks for your reply!

Here you go

These are from the second link.


And here is the code (same on both pages), I know it could probably be cleaner but I am a total beginner so thats what i came up with… What I dont understand is why it doesnt work the same on published and preview. And even further, if the codes and the names are the same on both pages

Hi Charles,

The events exist in code but are missing from the properties panel for some elements.
Make sure to add the events in the Properties panel for each vector element.

It is possible to bind the events in another way which doesn’t require using the properties panel:

$w.onReady(function () {
    $w("#myVector").onClick((event) => {
        //Do something
    });
});