Home >>jQuery Tutorial >jQuery wrapAll() Method

jQuery wrapAll() Method

jQuery wrapAll() Method

jQuery wrapAll() method in jQuery is used to wraps specified HTML elements around all selected elements.


Parameter Values

Parameter Description
wrappingElement It is a required parameter and is used to specifies what HTML element to wrap

Possible values:

  • jQuery objects
  • HTML elements
  • DOM elements
Here is an Example of jQuery wrapAll() Method:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
div{background-color: orange;}
<p class="txt1">This is a paragraph.</p>
<p class="txt1">This is another paragraph.</p>
<button class="btn1">Click me to Wrap a div element</button>