Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function () { $("button").click(function () { $("p").wrapAll('<div style="border: 1px solid red;">'); }); }); </script> </head> <body> <h1>jQuery Manipulation Methods: wrapAll()</h1> <div> <p>This is a paragraph</p> <p>This is a paragraph</p> </div> <button>Click Here to Test .wrapAll()</button> </body> </html>
Result: