title: check if input is checked using jquery
body: <p>How would I achieve this:</p>
  
  <pre><code>if($(this).parent().find('input:checked') == true)
  
  {$(this).find('.switch').attr('state','on');}
  else{$(this).find('.switch').attr('state','off');}
  </code></pre>
  
  <p>I know this is wrong but you get the idea I think :). If there is an input that is checked add state on if not state off.</p>