Q: How to change the region background color? (Oracle Apex 21.1) May I change the background color when a user clicks a button?
When that button (P21_CHECKOUT_BUTTON) is pressed, execute a process that changes the status OFF to ON or ON to OFF.
At this time, I want to change region (P21_CHECKOUT) color, ON: White OFF: YELLOW.
I found old question, but it is working only javascript.
Change Background-color to button in APEX Oracle
If there is no way to best solution for newer versions, then use this javascript to set the value to the item when you run PL/SQL.
The above question feel a bit old-fashioned. (but enough good.)
Can someone please give me an answer?
Thank you in advance :)

A: The link in the question uses jquery to manipulate the DOM element and set the background color. This could work but it definitely is not upgrade proof. It can be achieved declaratively in apex as well and that is a lot safer over time.
Here is an example of setting background color of a region click of a button. The same technique can be applied to add/remove the background color class for your process:
Page has a button (BUTTON1) and a region (REGION1)

*

*Create a dynamic action of event Click on BUTTON1.

*add a true action of action Add Class to the dynamic action

*

*settings > class: "u-color-7-bg"

*selection type "Region"

*button "REGION1"

*fire on initialization: off
That's all there is to it. The class "u-color-7-bg" comes from the universal theme reference application (Apex Universal Theme > Reference > Color and status modifiers). There are a number of predefined classes for block/text/background/border that can be used. These are upgrade proof and it is strongly advised to use these over home brewn solutions
