[jQuery] html() slightly broken

[jQuery] html() slightly broken


Hi all,
I think the html() method is slightly broken. The documentation says:
"If you provide no parameter to the html() method it will return the
innerHTML of the first element."
If you have only one item as result in your query, for example:
$('em', this.parentNode).html(); // $('em', this.parentNode).size() == 1
everything is ok, but if there are more elements, html() returns an
object and not the first element's innerHTML.
I ran into errors a few times now because of that.
Just thinking loud: It would be extra cool, if you could provide from
which element you want to take the HTML as an parameter, like html(3).
But then one had to be be really careful with the type you are passing
to html()...
Regards, Klaus
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/