Javascript examples for jQuery Method and Property:after
add loop in after function
<html> <head> <meta name="viewport" content="width=device-width"> <script src="https://code.jquery.com/jquery-3.1.0.js"></script> </head> //from w w w. ja v a2s. co m <body> <div class="block"></div> <script> $(document).ready(function(){ var divvs = ''; for(var i=0;i<15;i++){ divvs+= '<div>hello</div>' } $('.block').after(divvs); }); </script> </body> </html>