Modify ↓
Ticket #9188 (closed enhancement: wontfix)
Let .html() take multiple arguments like append()
| Reported by: | asjquery@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | unfiled | Version: | 1.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Let .html() take multiple arguments like append() does. Obviously I can use append() or prepend() after the html() call, but it's probably more efficient to do it in one function.
I can't simply string-append the html since it's jquery objects that I am inserting, not pure html.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Since .html() is intended for string html arguments it seems strange to use it this way. When the args are strings you can just append them together, so allowing multiple strings doesn't seem to offer anything. You can always just .append(jq1, jq2, jq3) if you have multiple jQuery objects.
Internally .html() often uses .empty().append() so I doubt it is slower, but you could write some jsperf.com tests.