title: Get value of checkbox as 1/0 with jQuery
body: <p>I want to get values of all input fields with jQuery. I can do that with following code. However if the input field is checkbox, and it is checked, it will return "<strong>on</strong>". How can I get the value as <strong>1</strong> if checked?</p>
  
  <p><strong>jQuery:</strong></p>
  
  <pre><code>$('button').click(function() {
  
      inputs = $('.input');
      inputs.each(function() {
          var value = $(this).val();  
          alert(value);
      }); 
  
  });
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;input type="text" class="input" /&gt;
  &lt;input type="text" class="input" /&gt;
  &lt;input type="checkbox" class="input"&gt;
  
  &lt;button&gt;Get values&lt;button&gt;
  </code></pre>
  
  <p><strong>Demo:</strong>
  <a href="http://jsfiddle.net/yDKdT/">http://jsfiddle.net/yDKdT/</a></p>