Bug Tracker

Opened 6 years ago

Closed 6 years ago

#13837 closed bug (notabug)

add() doesnt work as stated

Reported by: jeff.g.hunter@… 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

Change History (1)

comment:1 Changed 6 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.