What about you doing something like this:
$.fn.checked = function(b) {
b && this.attr('checked', 'checked') || this.removeAttr('checked');
}
but doing this we counting on both *attr* and *removeAttr* methods return
*true* on success (at least *attr* method).
John Resig wrote:
>
> $.fn.checked = function(b) {
> if ( b )
> this.attr( "checked", "checked" );
> else
> this.removeAttr( "checked" );
> };
>
> What do you think?
>
> --John
>
--
View this message in context:
http://www.nabble.com/Single-Value-Attributes-tf2373768.html#a6618527
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/