I'm making a form with inputs, if the input type is empty then the button submit is disabled but, if the input fields is with length > 0 the submit button is enabled
<input type='text' id='spa' onkeyup='check()'><br>
<input type='text' id='eng' onkeyup='check()'><br>
<input type='button' id='submit' disabled>
function check() {
if($("#spa").lenght>0 && $("#eng").lenght>0) {
$("#submit").prop('disabled', false);
} else {
$("#submit").prop('disabled', true);
}
}
it works but if then I delete for example the content of input spa the button submit is still enabled