Javascript 如何从页面上的button元素中删除disabled?

Javascript 如何从页面上的button元素中删除disabled?,javascript,Javascript,我正在使用此代码设置和删除网页上按钮的禁用属性: if (localStorage.buttonColor) { document.getElementsByTagName('html')[0].className = localStorage.buttonColor; var themeButtons = document.querySelectorAll(".theme"); for (var button in themeButtons) { the

我正在使用此代码设置和删除网页上按钮的禁用属性:

if (localStorage.buttonColor) {
    document.getElementsByTagName('html')[0].className = localStorage.buttonColor;
    var themeButtons = document.querySelectorAll(".theme");
    for (var button in themeButtons) {
        themeButtons[button].removeAttribute("disabled");
    }
    document.querySelector('button[name="' + localStorage.buttonColor + '"]').disabled = true;
}
但它给了我一个信息说:

Uncaught TypeError: Object 0 has no method 'removeAttribute'

有人能给我一些建议吗?

禁用
视为属性,而不是属性:

themeButtons[button].disabled = false;

将禁用的
视为属性,而不是属性:

themeButtons[button].disabled = false;

将禁用的
视为属性,而不是属性:

themeButtons[button].disabled = false;

将禁用的
视为属性,而不是属性:

themeButtons[button].disabled = false;