mardi 31 octobre 2017

how to make alerts appear if the number of infant is more than adults

I want to make the alert appear if the number of infant is more than adults. I've tried but it looks like something went wrong. Please help.. thanks before

ex: http://ift.tt/2yZ4y3c

var button = $('#submit'),
    adult = $('#adult option:selected').val(),
    infant = $('#infant option:selected').val();

if(adult > infant) {
 $("#alert").hide;
}
else if(adult == infant) {
 $("#alert").hide;
} 
else {
 $("#alert").show;
}

Aucun commentaire:

Enregistrer un commentaire