Is there a way to change the color of a button, or at least the color of the button label programmatically? I can change the label itself with
document.getElementById("button").object.textElement.innerText = "newlabel";
But how to change the color?
I have finally found a working code - try this:
I believe you want bgcolor. Something like this:
Here are a couple of demos that might help:
Background Color
Background Color Changer
Try this code You may want something like this
Then on your .js file enter this.Make sure your html is connected to your .js
Probably best to change the className:
Then you add a buton style to the CSS where you can set the background color and anything else.
If you assign it to a class it should work: