Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9188 closed enhancement (wontfix)

Let .html() take multiple arguments like append()

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6
Keywords: Cc:
Blocked by: Blocking:


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 (1)

comment:1 Changed 12 years ago by dmethvin

Resolution: wontfix
Status: newclosed

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.

probably more efficient

Internally .html() often uses .empty().append() so I doubt it is slower, but you could write some jsperf.com tests.

Note: See TracTickets for help on using tickets.