this.checked creating false positive?
<p>I have a page that has 4 checkboxes that are checked by default.  If you uncheck a box, it writes a cookie so that return trips to the page will have saved preferences.  The problem I'm having is that the cookies seem to be written no matter what.  Going to the page for the first time should create no cookies, but unchecking a box should throw the following code.  As it stands, the first time I'm going to my site, the cookies are created.</p>

<p>Where have I gone wrong (I wouldn't be surprised if it is in multiple places).</p>

<pre><code>$('#mycheckbox').change(function() {
if (! this.checked) {
&lt;?php setcookie('key', 'Value', time() + 4800); ?&gt;
}
});
</code></pre>
