JQuery WrapAll

 

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

Syntax: $ (selector) . wrapAll(wrap_element)


 
 
 
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("h3").wrapAll("<div></div>"); }); }); </script> <style> div{ border: 1px solid black; } </style> </head> <body> <h3>welcome to appwrk</h3> <h3>Our core values are the inspiration of our company–not only we see our values as the way we do business, but also the reason we do business and what strengthens our business. They have been there since the beginning of the organization and represent the way we (At APPWRK), our colleagues and our customers, deal with each other and drive our business approach. We believe in creating services to help people in completing their responsibilities as easily as possible.</h3> <button>wrapAll Me!</button> </body> </html>
Output