Skip to main content

Bug Tracker

Side navigation

#9188 closed enhancement (wontfix)

Opened May 09, 2011 10:25AM UTC

Closed May 09, 2011 01:47PM UTC

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

Reported by: asjquery@dsgml.com Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.6
Keywords: Cc:
Blocked by: Blocking:
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.

Attachments (0)
Change History (1)

Changed May 09, 2011 01:47PM UTC by dmethvin comment:1

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.