What happens if you call .checked() with no args?  Wouldn't that
automatically read as "false", leading to $( '#foo' ).checked() unchecking
the checkbox?

If called without any arguments, it should behave as if called with true
as an argument.

- Brian


> Hey everyone -
>
> I stumbled across a point of optimization today, all of the following
> attributes (and probably more - let me know) can only have a single
> value.
>
> checked="checked"
> multiple="multiple"
> disabled="disabled"
> readonly="readonly"
> disabled="disabled"
> selected="selected"
>
> I'd like to add in methods like:
> .checked( true | false )
>
> Which does this in the background (but for each attribute):
>
> $.fn.checked = function(b) {
>     if ( b )
>         this.attr( "checked", "checked" );
>     else
>         this.removeAttr( "checked" );
> };
>
> What do you think?
>
> --John


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to