Limited availability during the holidays
Another busy year is coming to its end, and an exciting year lies ahead. In order to get ready for a fresh new start, our team will spend a few days' rest during the winter holidays. Over the holiday break, we will have reduced staffing from December 20th, 2024, to January 5th, 2025, so please be patient if you do not receive a response as quickly as you normally would.
We send our warmest wishes for happiness, health, and success throughout the coming year. Thank you for your continued support, and may you have a peaceful and blessed Happy Holidays!
How do I target a button with JS to get an onclick event?
I've got a script that watches for buttons with a certain class, but the LS button links don't have a class (or ID) applied to them, so there's no direct way to target them. And they're not children of the class/id that's given to the button layer, so I'm not sure of a simple way to target those buttons.
Hello Joshua,
Thank you for getting in touch with us!
You should add a specific class or ID to the button layer and then you can use this selector for example:
#button-layer a
Other option is that, if you click to the links and attributes tab then you can add custom attributes for your button layer, for example an onclick event.
Best Regards,
Andrea | Kreatura Support Team
The ID and CLASS fields under Link & Attributes set those attributes of the previous child span on LS buttons...I tried playing around with things, and found that the ones labeled "On parent" actually set the attributes on the a - which was weird, but welcome to find, made it simple for doing what I needed as I could target using the rel attribute directly on the a element.
Thank you.
You are welcome!
Best Regards,
Andrea | Kreatura Support Team