My JavaScript code is supposed to change the color of a button, but I'm running into an issue where it says that getting the button is not a function. Strangely enough, the same function (with the same capitalization and case) works perfectly just a few lines above.
if (this.ButtonColor != "") {
var btn = document.getElementById('modal-close');
btn.style.backgroundColor = this.ButtonColor;
}