我有一个简单的JavaScript改变了按钮的颜色,但我不断得到错误,即按钮不是一个函数,即使相同的函数(具有相同的大小写和大小写)只能在上面几行.
if (this.ButtonColor != "") {
var button = document.getElementbyId('modal-close');
button.style.backgroundColor = this.ButtonColor;
}
Run Code Online (Sandbox Code Playgroud)