Checking/un-checking a checkbox with jQuery
<p>I am trying to toggle a checkbox between checked and un-checked using the following code, but it seems to only un-check.</p>

<pre><code>var checkbox = $this.find('[name="category"]');

if ('checkbox:checked') {
    checkbox.prop("checked", false);
} else {
    checkbox.prop("checked", true);
}
</code></pre>

<p>How can I make it toggle correctly?</p>

<p>Is there a better way to do this instead of doing if/else statements? .toggle() doesn't seem to work for checkboxes correct?</p>
