I have the following code JavaScript
, how do I change the background color of the button when it is disabled?
let campoSenha = document.querySelector('input[name="senha_imob"]');
let campoConfirmarSenha = document.querySelector('input[name="rsenha_imob"]');
let botao = document.querySelector('input[name="btn-entrar"]');
campoSenha.addEventListener('input', function(){
verificaCampos();
});
campoConfirmarSenha.addEventListener('input', function(){
verificaCampos();
});
function verificaCampos() {
if(campoSenha.value == campoConfirmarSenha.value && campoSenha.value.length > 8)
botao.disabled = false;
else
botao.disabled = true;
}
.frm-botao {
width: 100%;
background-color:#EA8419;
border:none;
cursor:pointer;
color:#FFFFFF;
font-size:25px;
font-weight:normal;
padding: 10px;
margin-top: 10px;
}
.frm-botao:hover {
background-color:#C16911;
}
<input type="submit" name="btn-entrar" value="ATUALIZAR" class="frm-botao" disabled />