Skip to main content

Bug Tracker

Side navigation

#13837 closed bug (notabug)

Opened April 29, 2013 11:07PM UTC

Closed April 29, 2013 11:21PM UTC

add() doesnt work as stated

Reported by: jeff.g.hunter@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

.add( selector )Returns: jQuery

Description: Add elements to the set of matched elements.

.add( jQuery object )

jQuery object

Type: jQuery object

An existing jQuery object to add to the set of matched elements


add doesnt actually add other jquery elements in 1.9.1

see:

http://jsfiddle.net/jdvax/

another bug, .add('#someid') does not seem to work either.

not sure what the actual functionality of add is, or how to add any elements to an object list

Attachments (0)
Change History (1)

Changed April 29, 2013 11:21PM UTC by rwaldron comment:1

resolution: → notabug
status: newclosed

Please read the documentation.

The following will not save the added elements, because the .add() method creates a new set and leaves the original set in pdiv unchanged:
var pdiv = $("p");
pdiv.add("div");  // WRONG, pdiv will not change

http://jsfiddle.net/rwaldron/DUsbG/ is correct.