Hi all, is ist possible to select elements by class? When you sell digital files, Wix adds a ugly icon (arrow pointing down) to each of their pictures in the gallery. I want to hide it via javascript but they have only class and data hook, no id of course and it would not make sense to select them via id. Is there a way to reference them? So far it looks like you can only l select elements by ID. Thanks!! Mauro
Yes, you can use JS in the dashboard > Settings > Custom Code
Either use CSS in the head to hide the class or (if it doesn’t work), set the custom code to the end of the body, and use javascript:
Select the element (either by document.getElementsByClassName(“classname”); or by document.querySelector(“.classname”); ) and set its style to display:none.
But (IMPORTANT):
-
Take into consideration that Wix might change this class name whenever they like and without any heads up.
-
Wix may add other elements with the same class name (it might break your page in some unwanted manner).
-
It’s your responsibility not to break the page code somehow.
P.S. this will only work for premium plan under your own domain.
- you won’t see it in preview mode.
Thanks a lot JD, much appreciated!
Mauro