Description
The .wrapAll() method wraps specified HTML element(s) around all selected elements.
v1.2
This method has the form:
.wrapAll(wrappingElement)
Parameter | Description |
---|---|
wrappingElement | (required) Specifies what HTML element(s) to wrap around the selected elements. Possible values:
|
Return Value
This form returns a jQuery object.
Examples
Wrap a div element around all p elements:
$("button").click(function(){
$("p").wrapAll("<div></div>");
});