Easy Tutorial
❮ Event Currenttarget Misc Unique ❯

jQuery add() Method

jQuery Traversal Methods

Example

Add <p> and <span> elements to an existing set of elements (<h1>):


Definition and Usage

The add() method adds elements to an existing set of elements.

This method adds elements to the entire document, unless a context parameter is specified, in which case it adds only within the context element.


Syntax

Parameter Description
element Required. Specifies the selector expression, jQuery object, one or more elements, or HTML snippet to add to the existing element set.
context Optional. Specifies the position in the document where the selector expression starts matching.

More Examples

DOM

HTML Snippet


jQuery Traversal Methods

❮ Event Currenttarget Misc Unique ❯