I have this code:
$('#inputID').on('keyup', function () {
if ($('#inputID').val() == '') {
$(".button").removeClass('uk-button-success');
} else {
$(".button").addClass('uk-button-success');
}
})
It requires a single input to be filled, so a specific button gets a class added. Now I want multiple inputs to be checked and if all of them are filled and not empty, I want to add the class "uk-button-success" to a button.
if ($('#inputID', '#inputID2').val() == '')
and other stuff I've tried didn't work.
How do I do this?
ORoperator:if ($('#inputID').val() == '' || $('#inputID2').val() == '' || ...) { /* some of them is empty */} else {/* all are filled */}my-input. And then you may use$('.my-input').on('keyup', function () {...?$(this).val()), but not other inputs (quote:I want multiple inputs to be checked and if all of them are filled and not empty).