Changing button color programmatically

后端 未结 7 1788
一整个雨季
一整个雨季 2020-12-16 10:13

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.getE         


        
7条回答
  •  半阙折子戏
    2020-12-16 10:44

    I have finally found a working code - try this:

    document.getElementById("button").style.background='#000000';
    

提交回复
热议问题