@info64604
Everything is possible!
This is all about → LOGIC ←
So, what excacly has to be happen, to achieve your desired function?
You have for example → 3x-Buttons.
All of them are for example → RED.
You click on one of the buttons to change clicked-button’s color and the button does it.
Now you click onto a second one and also changes the color of it for example to → blue!
Ok! Right now you have 2-buttons which have now the color → blue!
But normaly you wanted to change the color of the previous selected color back to red, right? → YES, RIGHT ! ![]()
But nowhere inside your current working code, this functionality is written down (coded).
That means you will have to expand your code.
My suggestion would be:
- First to set ALL-BUTTONS back to → ORIGINAL-COLOR
- Then mark one of the buttons with another color.
And everytime you select another button → first a → RESET_COLOR-functions runs and sets all BUTTONS to their → ORIGINAL-COLOR.
And in second step the color of the current selected-button changes to → blue.
This way, you always will have ONLY-1-BUTTON which will have a different color, compared with all buttons.
Now its on you!
Code your → resetButtonColors() - function
function resetButtonColors() {
...here the code for this function...
}