2
Hello, I’m trying to do a JS operation if a checkbox is checked, but I’m not succeeding. Follow the code:
$('#btn-proximo').click(function(e){
if($('#in_acesso').is('checked')){
$('#div_valida :input').each(function(){
if(this.value == "" || this.value == " "){
e.preventDefault();
this.focus();
}
if($('#password').val() != $('#password_confirmation').val()){
$('#dados_gerais').preventDefault();
$('#erroSenha').show('fade');
setTimeout(function(){
$('#erroSenha').hide('fade');
},6000);
$('#password').focus();
}
})
}
})
Put the
:
before checked, so.is(':checked')
– rray
change the line if($('#in_access').is('checked')){ to if($('#in_access').is(':checked'){ Only ":" was missing before "checked"
– Matheus Suffi