title: Hide DIV after click (jQuery)
body: <p>I have a list item that displays a hidden div once its clicked. I want to be able to hide the div if the list item is click on again. How can I do this?</p>
  
  <pre><code>$(function () {
      "use strict";
      function resetTabs() {
          $("#sub_content &gt; div").hide(); //Hide all content
          $("#tabs a").removeClass("current"); //Reset id's
      }
  
      $("#sub_content &gt; div").hide(); // Initially hide all content
  
      $("#tabs a").on("click", function (e) {
          e.preventDefault();
          resetTabs();
          $(this).addClass("current"); // Activate this
          $($(this).attr('name')).fadeIn(); // Show content for current tab
      });
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/E9mPw/" rel="nofollow">http://jsfiddle.net/E9mPw/</a></p>
  
  <p>Thanks.</p>