Changing button color programmatically September 15, 2023 by Tarik I have finally found a working code – try this: document.getElementById("button").style.background='#000000';