Skip to content
Related Articles

Related Articles

jQuery | wrapAll() with Examples

View Discussion
Improve Article
Save Article
  • Last Updated : 13 Feb, 2019

The wrapAll() method is an inbuilt method in jQuery which is used when the specified element will wrapped against all the selected elements.



Parameters: This method accept single parameter wrap_element which is mandatory. This parameter is used to specify that which element get wrapped around the selected element.

Return Value: This method returns the selected elements with the specified changes made by wrapAll() method.

Below example illustrates the wrapAll() method in jQuery:


<!DOCTYPE html>
        <title>The wrapAll Method</title>
        <script src=
        <!-- jQuery code to show the working of this method -->
            $(document).ready(function() {
                $("button").click(function() {
            div {
                background-color: lightgreen;
                padding: 20px;
                width: 200px;
                font-weight: bold;
                height: 60px;
                border: 2px solid green;
        <!-- click on this paragraph and see the change -->
        <p>Welcome to GeeksforGeeks!<br><br>
        <button>Click Here!</button></p>


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!