Javascript examples for jQuery Method and Property:wrapAll
Add div after an element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js"></script> <script type="text/javascript"> $(window).load(function(){//from ww w .j a va2s .c o m $("p").next().andSelf().wrapAll('<div id="test" />'); }); </script> </head> <body> <h2>test</h2> <p>test</p> <ul> <li>testlijst</li> </ul> </body> </html>