title: jQuery - how to select a href to toggle hide and show?
body: <p>Totally new to jQuery. I'm trying to select the a href tags that hide and show the div contents. I understand how to use the toggle, but not sure how to properly select the a href tags to initiate the toggle of the div tags. I have to be able to select the a href tag without changing the html source code. But when I set it to the div within the part3 id, all divs outside of the id part3 are also selected that are within the document are altered. Any help is appreciated. Thanks community.</p>
  
  <pre><code>    &lt;script type = "text/javascript"&gt;   
      $(document).ready(function () {
          $("#part3 h4").click(function () {
              $(this).next().toggle();
          });
  
          $("#part3 h4").mouseover(function() {
              $(this).addClass("faq over");
          });
  
          $("#part3 h4").mouseout(function() {
              $(this).removeClass("faq over");
          });
  
          $("#part3 &gt; a:first").click(function() {
              $("div").show(); // not sure how to access each a href tag
          });
      });
  &lt;/script&gt;
  
  &lt;div id="part3"&gt;
      &lt;h2&gt;3: FAQ Hide/Show Demo&lt;/h2&gt;
      &lt;a href="#"&gt;Show All&lt;/a&gt; | &lt;a href="#"&gt;Hide All&lt;/a&gt;
      &lt;div class="faq"&gt;          
              &lt;h4&gt;1.How much does it cost? &lt;/h4&gt;
              &lt;div&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
                   sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna 
                    &lt;strong&gt;aliquam&lt;/strong&gt; erat volutpat. Ut wisi enim ad minim veniam, quis nostrud 
                   exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea 
                   commodo consequat. &lt;/p&gt;
              &lt;/div&gt;
              &lt;h4&gt;2.What is the meaning of life? &lt;/h4&gt;
              &lt;div&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
                   sed diam nonummy nibh euismod tincidunt&lt;strong&gt; ut laoreet dolore&lt;/strong&gt; magna 
                   a&lt;em&gt;liquam erat volutpat. Ut wisi e&lt;/em&gt;nim ad minim veniam, quis nostrud 
                   exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea 
                   commodo consequat. &lt;/p&gt;
              &lt;/div&gt;
              &lt;h4&gt;3.Why is the sky blue?&lt;/h4&gt;
              &lt;div&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
                   sed diam nonummy nibh euismod tincidunt ut laoreet &lt;strong&gt;dolore magna 
                   aliquam&lt;/strong&gt; erat volutpat. Ut wisi enim ad minim veniam, quis nostrud 
                   exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea 
                   commodo consequat. &lt;/p&gt;
              &lt;/div&gt;
              &lt;h4&gt;4.Why is the real cost of money?&lt;/h4&gt;
              &lt;div&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit,
                   sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna 
                   aliquam erat volutpat. &lt;strong&gt;Ut wisi enim ad minim&lt;/strong&gt; veniam, quis nostrud 
                   exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea 
                   commodo consequat. &lt;/p&gt;
              &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>