You can't. You'll need to create an event listener on that button and, whenever it's clicked, you can call the function you wish.
Thank you for your response.
As the Button's class is generic and there are multiple Buttons that have the same class, how is one to assign an unique ID to the button to create an event listener on that button?
I haven't. Thanks for asking. Hoping someone has and can post it here.
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...By Jacqui Mar 10, 2023
Upskill and stand out with the new Shopify Foundations Certification programBy SarahF_Shopify Mar 6, 2023
One of the key components to running a successful online business is having clear and co...By Ollie Mar 6, 2023