title: Multiple jquery Scripts on one page
body: <p>I am brand new to Jquery and have run into something that if answered will help greatly in the future. I have 2 very simple questions
  I am using codeigniter, HTML5 and all php pages as well.</p>
  
  <p>I have a menu 'aside' with 4-5 sections that I want to be able to close to save space. So I am using 2 simple slideToggle scripts.</p>
  
  <pre><code>$("a").click(function () {
     $('#cat').slideToggle('slow', function() {
      })
  });    
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$("button").click(function () {
    $('#dog').slideToggle('slow', function() {
      })
  });     
  </code></pre>
  
  <p>The problem is, if I use button on both, both scripts operate even though I am requesting the script to run on 2 different ID's ( I know the dog and cat thing is silly, I just threw them in to see if a fake id would work and it did)</p>
  
  <p><strong>The question is, how can I use button OR a href on both scripts to preserve my styling?</strong></p>
  
  <p>My second question is can you put multiple scripts on a .js file for inclusion and how would you do it? Does each get script tags or some other kind of separator?</p>
  
  <p>Thanks for helping, these are my first two scripts.  At least they work :)</p>
  
  <pre><code>    &lt;div class="menu"&gt;
  &lt;h2&gt;News Links&lt;/h2&gt;
  
   &lt;a href="#"&gt;Display&lt;/a&gt;
   &lt;!--
  if I use "button" here, both scripts run on tandem
  --&gt;
  &lt;script&gt;
   $("a").click(function () {
    $('#cat').slideToggle('slow', function() {
      })
  });     
  </code></pre>
  
  <p>
     
      
      benchmark->mark('links_start');
      $this->db->order_by('id', 'DESC');
      $this->db->limit('10');
      $query = $this->db->get('links');
      foreach ($query->result() as $row)<br>
          {
      echo "link \"  title=\"$row->title\" target=\"_blank\">$row->name  </li>";
          }
          $this->benchmark->mark('links_end');</p>
  
  <pre><code>    ?&gt;
     &lt;/ul&gt;
     &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="menu"&gt;
     &lt;h2&gt;Archives&lt;/h2&gt;
     &lt;button&gt;Display&lt;/button&gt; &lt;!--if I use "a" here, both scripts run on tandem
       --&gt;
      &lt;script&gt;
    $("button").click(function () {
    $('#dog').slideToggle('slow', function() {
      })
    });     
    &lt;/script&gt;
    &lt;div id="dog"&gt;
    &lt;?php
  $this-&gt;db-&gt;order_by('id', 'DESC');
  $where = "publish";
  $this-&gt;db-&gt;where('status', $where);
  $this-&gt;db-&gt;select('id, title', FALSE);
  $this-&gt;db-&gt;select('DATE_FORMAT(date, "%b %D %Y")AS date');
  $this-&gt;db-&gt;from('posts');
  $query = $this-&gt;db-&gt;get();
  foreach ($query-&gt;result() as $row)          
  </code></pre>