Using javascript to dynamically change button icons

Hi all. I have an app for which I’d like to dynamically change the icons used in a button block. CSS seems to be a dead end, or too complex. Is there a way to do this using javascript? I need help understanding how to use javascript with Glide more than I need the specific javascript syntax.

All help appreciated.

Javascript can’t be directly injected into the front end of an app. You can use it in the data though. If you wanted javascript to come into play to manipulate things on the front end, then you would have to work with the custom AI component and try to get it to show your buttons the way you want and call separate actions for each button.

1 Like

Can you explain more on the conditions needed to change the color? CSS should be good for this.

I’m not trying to change the color. CSS is for that. I’m trying to change the icon, the svg href.

Sorry, I got confused on my first read. I think you got your issue solved on another thread.