Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 5
    @David, why the bizarre use of call? btn.add(h3) works... Commented Dec 10, 2009 at 15:53
  • 1
    Because I do not know the first object, so I can't chain. Apply() would be even better, so I can send an array using $.fn.add.apply(arr.shift(),arr); Commented Dec 10, 2009 at 16:21
  • 1
    is there a way to add more than 2 objects ? Commented Mar 31, 2010 at 7:41
  • 12
    If you don't know the first object, you can avoid using call by chaining off an empty jQuery object: $().add(btn).add(h3). IMO, this is a much better way to use $.add. Commented Aug 19, 2010 at 18:58
  • 1
    is this basically a duplicate of stackoverflow.com/questions/323955/… Commented Aug 28, 2014 at 21:43