"); }); ``` --- ##"> "); }); ``` --- ##" />
Easy Tutorial
❮ Misc Isxmldoc Traversing Closest ❯

jQuery wrapAll() Method

jQuery HTML/CSS Methods

Example

Wrap all <p> elements within a <div> element:

$("button").click(function(){
    $("p").wrapAll("<div></div>");
});

Definition and Usage

The wrapAll() method wraps a specified HTML element around all selected elements.


Syntax

Parameter Description
wrappingElement Required. Specifies the HTML element to wrap around the selected elements. Possible values: HTML element<br> jQuery object<br> DOM element

More Examples

Create New Elements via DOM


jQuery HTML/CSS Methods

❮ Misc Isxmldoc Traversing Closest ❯