[jQuery] Re: uncheck specific checkbox

2009-02-12 Thread mkmanning
Unfortunately all is not simple in browser-land. You can use checked with no values, or checked="checked" or checked="true|false" and get what you want/expect given a particular doctype. Even coding to XHTML standards doesn't mean the browser will follow the standards, since most XHTML is rendered

[jQuery] Re: uncheck specific checkbox

2009-02-12 Thread Frederik Ring
Well thanks for that, I didn't know and it seems to work perfectly But why is it then when I do something like an alert($(mycheckbox).attr ('checked')); on an unckecked checkbox it returns false? On Feb 12, 5:46 pm, mkmanning wrote: > In HTML checked is a boolean (of sorts), its presence is suff

[jQuery] Re: uncheck specific checkbox

2009-02-12 Thread mkmanning
In HTML checked is a boolean (of sorts), its presence is sufficient, you don't need to set it to anything; if you want something unchecked you should remove the 'checked' attribute. In XHTML, attribute minimization is forbidden (i.e. attributes can't be empty), so the proper syntax is checked="che

[jQuery] Re: uncheck specific checkbox

2009-02-12 Thread Frederik Ring
Hi! The thing is that somwhow (don't ask me why) the unchecked attribute of a checkbox is '' instead of 'false'. This worked fine with me: HTML: jQuery: $(document).ready(function(){ $('.childcheckbox').change(function(){ $(this).prev('.parentcheckbox').attr('checked