I strongly suggest you to compare if a variable is equal to undefined using the typeof unary operator, because if you, someday, dicide to get these things work on IE 5, you can not compare to the undefined constant (?), after all, it doesn't exist on IE 5.0. Compare like this one:
if(b || typeof b == 'undefined') { ... John Resig wrote: > > Sure, makes sense to me: > > $.fn.checked = function(b) { > if ( b || b == undefined ) > this.attr( "checked", "checked" ); > else > this.removeAttr( "checked" ); > }; > > --John > -- View this message in context: http://www.nabble.com/Single-Value-Attributes-tf2373768.html#a6618812 Sent from the JQuery mailing list archive at Nabble.com. _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/