I have the following HTML and would like a check in javascript
to see if in the fields the characters entered are equal to and greater than eight digits, to enable the% / p>
I have a code submit
that checks the number of characters, but I also need to verify that the fields are equal and enable the button if everything is positive.
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(){
document.querySelector("[name='senha_imob']").oninput = function(){
this.style.backgroundColor = this.value.length >= 8 ? "red" : "#D9ECF1";
}
});
</script>
<input name="senha_imob" type="password" class="imv-frm-campo">
<input name="rsenha_imob" type="password" class="imv-frm-campo">
<input type="submit" name="btn-entrar" value="ATUALIZAR" class="frm-botao" />