title: Twitter Bootstrap checkbox-button value changed after click event
body: <p>I have a checkbox-button-group like this:</p>
  
  <pre><code>&lt;div class="btn-group" id="id_group" data-toggle="buttons-checkbox"&gt;
    &lt;button class="btn myclass" type="button" data-value="0"&gt;Value 0&lt;/button&gt;
    &lt;button class="btn myclass" type="button" data-value="1"&gt;Value 1&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the JS event handler:</p>
  
  <pre><code>$(".myclass").click(function(event) {
    console.log($(".myclass.active").length);
    console.log($(this).hasClass("active"));
  });
  </code></pre>
  
  <p>I want to get the <code>data-value</code> for all checked buttons, but on the <strong>click</strong> event, the <code>active</code> class is not yet set. That means, when I first click a button, the output is:</p>
  
  <pre><code>&gt;&gt;&gt; 0
  &gt;&gt;&gt; false
  </code></pre>
  
  <p>And the next time I click the same button (i.e., uncheck it), the output is:</p>
  
  <pre><code>&gt;&gt;&gt; 1
  &gt;&gt;&gt; true
  </code></pre>
  
  <p>That means the <code>active</code> class is being set after the event.</p>
  
  <p>How can I get the real state of the button during the <strong>click</strong> event?</p>