I am trying to do a 2 input text check and when the keyup is executed, even if only the input name is filled, it enters the else and the IF is not fulfilled.
JS
$( document ).ready(function() {
$("#formulario input").keyup(function() {
$NombreText = $("#name").val();
$ApellidosText= $("#surname").val();
if( $NombreText.length<=0 && $ApellidosText.length<= 0){
console.log("vacio")
}
else{
console.log("lleno")
}
});
});
HTML
<form id="formulario" action="">
<label for="">Nombre</label>
<input type="text" id="name">
<label for="">Apellidos</label>
<input type="text" id="surname">
<button>ENVIAR</button>
</form>