treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Is there a better way to write this?


  • $('#close-content').click(function(){
    $('.content-container').hide();
    $('#projects-panel').hide();
    $('#sitelocations-panel').hide();
    $('#team-panel').hide();
    $(this).hide();
    });


    Seems like it should one line or something. :)
  • $('#close-content').click(function(){
    $('.content-container, #projects-panel, #sitelocations-panel, #team-panel, #close-content').hide();
    });
  • Ah, I knew it! Thanks wolf!