title: How do I check the state of JQuery slide toggles?
body: <p>So I have an accordion menu to display results and a "Show All" button at the top so that the user doesn't have to click each one to expand it. When they click "Show All", all of the content expands out, and the button's text switches to say "Hide All".</p>
  
  <p>However, I want to make sure that if the user decides to manually close all of the sections himself, then the button will switch from "Hide All" to "Show All" again.</p>
  
  <p>I'd like this to work the other way too, just in case they open all of them (or perhaps any number of them). It'd be nice if I could get the button to then say "Hide All".</p>
  
  <p>Make sense? It should be relatively simple...I'm just new to JQuery, and I'm not sure how to check the state of the toggle. Here's the code I have to expand all of the sections.</p>
  
  <pre><code>    function expandAll() {
          if(document.getElementById("displayMajors").innerHTML == "Show All") {
              $('.accordionContent').slideDown('normal');
              document.getElementById("displayMajors").innerHTML = "Hide All";
          }
          else { 
              $('.accordionContent').slideUp('normal');
              document.getElementById("displayMajors").innerHTML = "Show All";
          }
       }
  </code></pre>
  
  <p>"displayMajors" is the ID of the button, and "accordionContent" is a div class.</p>