Select element by class

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):

  1. Take into consideration that Wix might change this class name whenever they like and without any heads up.

  2. Wix may add other elements with the same class name (it might break your page in some unwanted manner).

  3. 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.
1 Like

Thanks a lot JD, much appreciated!
Mauro