FWIW, I would recommend using this work around instead:
$("<div/>").text( text + "" ).append($("<span/>"));
null better and saves 1 byte.
Also, FWIW, this bug also affects
$.fn.height, and number other functions.
I replied to http://bugs.jquery.com/ticket/5571, but it might be worth repeating my argument here. Basically, I feel that the getter/setter functionality should be determined by
arguments.length instead of the argument values. IMO, this leads to a more consistent API and is less surprising to the user.
There is the argument that
undefined is an invalid value, so breaking the chain makes sense since it acts like a form of error reporting. I disagree with this logic. As a form of error reporting, breaking the chain doesn't always work and leads to confusing error messages. (See ticket for more detailed explanation).