title: jQuery Retrieve ID
body: <p>I tried tackling my first project, an accordion menu. I have set to each item that needs to show/hide a class of .menu and an id.</p>
  
  <p>While trying to retrieve the id's of each element i've used this statement:</p>
  
  <pre><code>var $currentId = $('ul.menu').attr('id');
  </code></pre>
  
  <p>Only problem is that it seems this only retrieves the id of the first element. Can anyone tell how can I retrieve all the It's to store them in a variable. I am planing to use if statements in order to check  for each particular id when it's clicked.Thank You!</p>
  
  <p>EDIT:It seems I was misunderstood what I have to do is this I'll start from the beginning:</p>
  
  <p>Here is my HTML :</p>
  
  <pre><code>&lt;ul id="container"&gt;
      &lt;li class="select"&gt;&lt;a href ="#"&gt;Downloads&lt;/a&gt;&lt;/li&gt;
  
      &lt;li &gt;
          &lt;ul class = "menu" id="first" &gt;
              &lt;li&gt;
                  &lt;a href ="#"&gt;iTunes&lt;/a&gt;
              &lt;/li&gt;
              &lt;li&gt;
                  &lt;a href ="#"&gt;iTunes&lt;/a&gt;
              &lt;/li&gt;
  
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li class="select"&gt;
          &lt;a href ="#"&gt;Products List  &lt;/a&gt;
      &lt;/li&gt;
       &lt;li&gt;
           &lt;ul class = "menu" id="second"  &gt;
              &lt;li&gt;
                  &lt;a href ="#"&gt;iTunes&lt;/a&gt;
              &lt;/li&gt;
  
              &lt;li&gt;
                  &lt;a href ="#"&gt;iTunes&lt;/a&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
  </code></pre>
  
  <p>What I have to do is when I click on the li with class of select I have to make the ul with the class of menu appear. How I wanted to do this to retrieve all the id's of the ul.menu and store them in a variable and when I click on any of the li.select the underlying ul should show.</p>