change color of button code example
Example 1: javascript change color of button
document.getElementById("button").style.background='#000000';
Example 2: change button color html
.button {
background-color: #4CAF50;
}
document.getElementById("button").style.background='#000000';
.button {
background-color: #4CAF50;
}