Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:13:18+00:00 2026-06-15T18:13:18+00:00

I am new to JQuery and I found Code School so I am taking

  • 0

I am new to JQuery and I found Code School so I am taking their course to learn it. I am completing one of the Challenges and this is the Challenge presented:

Find all the window seats (a & d in first class, and a & f in economy) using any tools necessary.

Here is the code they provide:

<div id="seating_chart">
  <ul id="first_class">
    <li id="row_1">
      <ul>
        <li class="premium a"></li>
        <li class="premium b"></li>
        <li class="aisle"></li>
        <li class="premium c"></li>
        <li class="premium d"></li>
      </ul>
    </li>
    <li id="row_2">
      <ul>
        <li class="premium a"></li>
        <li class="premium b"></li>
        <li class="aisle"></li>
        <li class="premium c"></li>
        <li class="premium d"></li>
      </ul>
    </li>
  </ul>
  <ul id="economy_class">
    <li id="row_3">
      <ul>
        <li class="a"></li>
        <li class="b"></li>
        <li class="c"></li>
        <li class="aisle"></li>
        <li class="d"></li>
        <li class="e"></li>
        <li class="f"></li>
      </ul>
    </li>
    <li id="row_4">
      <ul>
        <li class="a"></li>
        <li class="b"></li>
        <li class="c"></li>
        <li class="aisle"></li>
        <li class="d"></li>
        <li class="e"></li>
        <li class="f"></li>
      </ul>
    </li>
    <li id="row_5">
      <ul>
        <li class="a"></li>
        <li class="b"></li>
        <li class="c"></li>
        <li class="aisle"></li>
        <li class="d"></li>
        <li class="e"></li>
        <li class="f"></li>
      </ul>
    </li>
    <li id="row_6">
      <ul>
        <li class="a"></li>
        <li class="b"></li>
        <li class="c"></li>
        <li class="aisle"></li>
        <li class="d"></li>
        <li class="e"></li>
        <li class="f"></li>
      </ul>
    </li>
  </ul>
</div>

And here is what I came up with:

$('#first_class > li > ul > li.premium.a, li.premium.d, #economy_class >li > ul> li.a, li.f');

Now this code worked but I am wondering if there was an easier/better way to accomplish the Challenge? I want to learn as much as possible so my code is clean and efficient.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:13:19+00:00Added an answer on June 15, 2026 at 6:13 pm

    While your answer has successfully found the elements you are looking for. It makes it hard for your team mates (in a real world project) to understand what you have done, and even for yourself this is hard to maintain.

    What if the spec you were given was wrong (common) or has changed? (common) – on a large project this code: $('#first_class > li > ul > li.premium.a, li.premium.d, #economy_class >li > ul> li.a, li.f'); will take you far longer to debug in my opinion compared to something like:

    var $seating_chart = $('#seating_chart');
    var $first_class = $seating_chart.find('#first_class');
    var $first_class_window_seats = $first_class.find('.a, .d');
    var $economy_class = $seating_chart.find('#economy_class');
    var $economy_class_window_seats = $economy_class.find('.a, .f');
    

    Now, when we want to further process the elements that we have found – we know exactly what they are for, and I think this code helps my fellow team mates understand what is going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im very new to jquery/javascript. So here goes, I found this js code for
Ok, so I'm quite new to jQuery, but found this bizzare problem just now,
im new to jquery and javascript.. Here is the code, this is a sample,
I am just trying to learn jQuery and I found one problem. I have
I'm new in JQuery, I found this link: jQuery Effects and I want to
Using jQuery UI 1.8rc3 combined with the new jquery.effects.fade.js code, I've been able to
I have found a code to show Google maps with multiple markers using JQuery
I'm using the accordion code found on this site . My version of the
I am quite new with jQuery, the following code is a collage of 2
I'm new to JQuery and Web Services. My question is (in the following code),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.