Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13837 closed bug (notabug)

add() doesnt work as stated

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:


.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

Change History (1)

comment:1 Changed 10 years ago by Rick Waldron

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.

Note: See TracTickets for help on using tickets.