Изменение цвета неактивной кнопки
const resetButton = container.querySelector('.input__btn_reset');
if (elem.length === 0) {
resetButton.setAttribute('disabled', true);
// Как задать неактивной кнопке другой цвет фона?
[S]resetButton.style.backgroundColor.setAttribute('#f00', true)[/S]
}
|
knoxville88,
resetButton.style.backgroundColor = '#f00'; |
knoxville88,
style |
рони,
а через set.Attribute('style.backgroundColor:#f00', true) ? set.Attribute('style', backgroundColor:#f00') понял |
knoxville88,
лучше менять class элемента, а не атрибут style. |
рони,
понял, спасибо! :) |
| Часовой пояс GMT +3, время: 10:43. |