jeudi 24 novembre 2016

Use jquery IF statement for two different IDs

this is probably dead simple but I just can find a solution myself. I have this code:

      $('article li.active').each(function() {
        if ($(this).attr('id') == 'arrival-and-departure') {
          $('p.quot').hide();
        }
        else if ($(this).attr('id') == 'additional-needs') {
          $('p.quot').hide();
        }
        else {$('p.quot').show()}
      };

I was wondering how I could combine the two IFs so that I just need IF and Else. Any help would be very welcome, thanks!

Aucun commentaire:

Enregistrer un commentaire