@
dragosu I agree it would help to have that documented better. The problem with documentation is that it is most useful if the specific fact you currently do not know is at the point you currently happen to be looking. :)
Something in the docs for jQuery() might help: jQuery sets are primarily meant to contain elements (DOM nodeType==1). If text or comment nodes are in a set, they may be ignored or unintuitively processed by jQuery filtering, traversal or manipulation methods.
The whole story is more complex of course; a jQuery set can also have text nodes, comment nodes, DOM elements, plain JavaScript objects, document objects, or window objects but only subsets of the full API work on them. The APIs generally describe what they do for those cases. But it seems excessive and distracting to tell people that $(document).appendTo(window) is nonsensical.
If you're interested in doing something more extensive to improve the docs we could certainly talk further. The documentation is all open source and we welcome contributions. See
http://contribute.jquery.org for more info.