title: JQuery: if div is visible
body: <p>I'm using JS as a way of changing the content of an SPA I'm creating. When I press a button to change the content the HTML changes from this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="selectDiv" style="display: none;"&gt;
  </code></pre>
  
  <p>to this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="selectDiv" style&gt;
  </code></pre>
  
  <p>Now part of my SPA has a div that contains a number of checkboxes, each representing a div, and so when I press the submit button, the next div that should be displayed will be the first item in the checkbox list that was selected.</p>
  
  <p>I'm wondering if there's a way in JQuery for the code to "almost detect" which div is now visible. something like this:</p>
  
  <pre><code>if($('#selectDiv').isVisible()){
      //JS code associated with this div.
  }
  </code></pre>
  
  <p>Any suggestions?</p>