Dynamically Change the Color of a Button

Currently I have buttons set to Type primary. I would like to be able to change one button on a form to Light or a specific color slategray, based upon a met condition within the form. Is this possible?

Hello @cwalter2,

To change the styling of any element on the form dynamically use JQuery css() method.

But first, add a class to the button, e.g. 'test-btn'

and then, you can change the background of the button using the code:

$(".test-btn").css("background-color", "slategray");
1 Like