Javascript examples for jQuery Method and Property:wrap
Wrap element in a div after creating it
<html> <head> <meta name="viewport" content="width=device-width"> <script src="https://code.jquery.com/jquery-3.1.0.js"></script> </head> /* w w w. j a v a2 s. c om*/ <body> <script> $(function(){ $('<div class="dropdown" style="top: 50px; left: 50px;">test</div>').appendTo($('<div class="container"></div>').appendTo($("body"))); }); </script> </body> </html>